L_TO_CONFIRM - TO 확정 (예제 코드 포함)

2023. 3. 27. 13:50ABAP/BAPI

728x90
반응형

안녕하세요 파피킴입니다.

오늘은 미확정 TO 를 바피를 이용하여 확정 처리 하는 방법을 알아보도록 하겠습니다.

티코드로는 LT12 이죠~

DATA : lt_ltap_conf TYPE TABLE OF ltap_conf WITH HEADER LINE.

lt_ltap_conf-tanum = 'TO 번호'.    " TO 번호
lt_ltap_conf-tapos  = '품목 번호'.  " 품목 번호
lt_ltap_conf-nista   = '수량'.          " 수량
lt_ltap_conf-altme  = '단위'.          " 단위
lt_ltap_conf-ndifa   = '차이 수량'.  " 차이 수량은 999 저장유형 TO 빈에 소거
lt_ltap_conf-nlpla   = '목적 빈'.      " 목적 빈 변경
APPEND lt_ltap_conf.

CALL FUNCTION 'L_TO_CONFIRM'
    EXPORTING
        i_lgnum                                           = '창고 번호'  " 창고 번호
        i_tanum                                           = 'TO 번호'     " TO 번호
        i_squit                                              = ' '                " 전체 품목 확정 지시자
    TABLES
        t_ltap_conf                                       = lt_ltap_conf
    EXCEPTIONS
        to_confirmed                                   = 1
        to_doesnt_exist                              = 2
        item_confirmed                               = 3
        item_subsystem                              = 4
        item_doesnt_exist                           = 5
        item_without_zero_stock_check   = 6
        item_with_zero_stock_check         = 7
        one_item_with_zero_stock_check = 8
        item_su_bulk_storage                     = 9
        item_no_su_bulk_storage               = 10
        one_item_su_bulk_storage             = 11
        foreign_lock                                      = 12
        squit_or_quantities                          = 13
        vquit_or_quantities                          = 14
        bquit_or_quantities                          = 15
        quantity_wrong                                 = 16
        double_lines                                      = 17
        kzdif_wrong                                       = 18
        no_difference                                     = 19
        no_negative_quantities                    = 20
        wrong_zero_stock_check                = 21
        su_not_found                                    = 22
        no_stock_on_su                               = 23
        su_wrong                                           = 24
        too_many_su                                     = 25
        nothing_to_do                                   = 26
        no_unit_of_measure                         = 27
        xfeld_wrong                                       = 28
        update_without_commit                   = 29
        no_authority                                       = 30
        lqnum_missing                                   = 31
        charg_missing                                    = 32
        no_sobkz                                             = 33
        no_charg                                             = 34
        nlpla_wrong                                        = 35
        two_step_confirmation_required      = 36
        two_step_conf_not_allowed              = 37
        pick_confirmation_missing                = 38
        quknz_wrong                                       = 39
        hu_data_wrong                                    = 40
        no_hu_data_required                          = 41
        hu_data_missing                                  = 42
        hu_not_found                                       = 43
        picking_of_hu_not_possible               = 44
        not_enough_stock_in_hu                    = 45
        serial_number_data_wrong                 = 46
        serial_numbers_not_required             = 47
        no_differences_allowed                       = 48
        serial_number_not_available              = 49
        serial_number_data_missing              = 50
        to_item_split_not_allowed                   = 51
        input_wrong                                           = 52
        OTHERS                                                  = 53.

IF sy-subrc IS INITIAL.
    MESSAGE s000 WITH 'SUCCESS'.
ELSE.
    MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
                       WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
                       DISPLAY LIKE sy-msgty.
ENDIF.

 

예외 코드가 많아서 조금 당황하셨을 수도 있을 것 같아요~

TO 의 전체 품목을 확정 처리 하실 때는 인터널 테이블을 빈 값으로 주시고 i_squit 에 'X' 넣어주시면 됩니다.

수량 변경이 필요할 경우 인터널 테이블에 실제 수량, 단위, 차이수량을 계산해서 넣어 주시면 되고, 목적 빈도 변경이 필요할 경우 해당 빈을 넣어 주시면 된답니다.

실제로 사용해 보시면 별로 어렵지 않으실 거예요~

혹시 질문 있으시면 댓글 부탁드리겠습니다~

이상 샙가능의 파피킴이었습니다.

728x90
반응형