Skip to Content

ODO Post good issue with developed RFUI

Hi all ,

I will develop a RFUI to post good issue of outbound delivery order.

User will select ODO than click post good issue button thats all.

Could you share your advices ?

Class , FM , PPF ?

Brgds

M.Ozgur Unal

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    Posted on Oct 20, 2018 at 11:14 AM

    Actially, you can benefit from this program. I can not achieve with /scwm/cl_goods_movement=>post_dlv

    TABLES : zewms_uretime_transfer.
    DATA : gs_huhdr TYPE /scwm/huhdr,
    
     gs_huref TYPE /scwm/huref,
    
     gs_item TYPE /scdl/db_proci_o,
    
     gs_refdoc TYPE /scdl/db_refdoc,
    
     gs_lips TYPE lips,
    
     gs_makt TYPE makt,
    
     gs_palet TYPE /mdy/ppt_palet.
    *& Include ZEWM_PALET_ESLESTIRME_FORM
    
    *&---------------------------------------------------------------------*
    
    *&---------------------------------------------------------------------*
    
    *& Module STATUS_1100 OUTPUT
    
    *&---------------------------------------------------------------------*
    
    *&
    
    *&---------------------------------------------------------------------*
    
    MODULE status_1100 OUTPUT.
    
     SET PF-STATUS 'STANDART'.
    
     SET LEBAR 'STANDART_'.
    
    ENDMODULE.
    
    *&---------------------------------------------------------------------*
    
    *& Module USER_COMMAND_1100 INPUT
    
    *&---------------------------------------------------------------------*
    
    * text
    
    *----------------------------------------------------------------------*
    
    MODULE user_command_1100 INPUT.
    
     CASE sy-ucomm.
    
     WHEN 'B_SAVE'.
    
     PERFORM transfer.
    
     ENDCASE .
    
    ENDMODULE.
    
    *&---------------------------------------------------------------------*
    
    *& Module USER_COMMAND_1100_EXIT INPUT
    
    *&---------------------------------------------------------------------*
    
    * text
    
    *----------------------------------------------------------------------*
    
    MODULE user_command_1100_exit INPUT.
    
     CASE sy-ucomm.
    
     WHEN 'EXIT' OR 'B_BACK'.
    
     LEAVE TO SCREEN 0 .
    
     ENDCASE .
    
    ENDMODULE.
    MODULE palet_check.
    
     CLEAR : gs_huhdr,gs_huref,gs_item,gs_refdoc,gs_lips,gs_palet,
    
     gs_makt,
    
     zewms_uretime_transfer-umlgo,
    
     zewms_uretime_transfer-/scwm/stagarbin,
    
     zewms_uretime_transfer-productno,
    
     zewms_uretime_transfer-maktx,
    
     zewms_uretime_transfer-stock_category,
    
     zewms_uretime_transfer-kunnr,
    
     zewms_uretime_transfer-urt_tar,
    
     zewms_uretime_transfer-urt_saat,
    
     zewms_uretime_transfer-charg.
    */scwm/huhdr git GUID i al
    
    */scwm/huref GUID i ver komple satırı al /scwm/huref-DOCID BAPI ye göndereceğin DOCID yi verir.
    
    */SCDL/DB_PROCI_O TABLOSUNA git
    
    *DOCID = /scwm/huref-DOCID and
    
    *ITEMNO = '10' ver
    
    *
    
    */SCDL/DB_REFDOC-DOCID = /scwm/huref-DOCID
    
    *LIPS-VBELN = /SCDL/DB_REFDOC-REFDOCNO
    
    *
    
    *Palet No =
    
    *Depo Yeri = LIPS-UMLGO
    
    *Adres = /SCDL/DB_PROCI_O-/SCWM/STAGARBIN
    
    *Malzeme = /SCDL/DB_PROCI_O-PRODUCTNO
    
    *Ürün (maktx ) = i
    
    *Stok Türü = /SCDL/DB_PROCI_O-STOCK_CATEGORY
    
    *Müşteri = /MDY/PPT_PALET-kunnr
    
    *Ürt. Trh. /Saat = /MDY/PPT_PALET-URT_TAR
    
    *Parti = /MDY/PPT_PALET-charg
     CHECK zewms_uretime_transfer-palet_no IS NOT INITIAL .
     SELECT SINGLE * FROM /scwm/huhdr INTO gs_huhdr
    
     WHERE huident EQ zewms_uretime_transfer-palet_no.
    
     IF sy-subrc <> 0 .
    
     MESSAGE 'Palet no bulunamadı !' TYPE 'I' DISPLAY LIKE 'E'.
    
     RETURN .
    
     ENDIF .
     SELECT SINGLE * FROM /scwm/huref INTO gs_huref
    
     WHERE guid_hu EQ gs_huhdr-guid_hu.
     SELECT SINGLE * FROM /scdl/db_proci_o INTO gs_item
    
     WHERE docid EQ gs_huref-docid
    
     AND itemno EQ '10'.
     SELECT SINGLE * FROM /scdl/db_refdoc INTO gs_refdoc" Teslimat No bulunuyor
    
     WHERE docid EQ gs_huref-docid.
     SELECT SINGLE * FROM lips INTO gs_lips
    
     WHERE vbeln EQ gs_refdoc-refdocno.
     SELECT SINGLE * FROM /mdy/ppt_palet INTO gs_palet
    
     WHERE paletno EQ zewms_uretime_transfer-palet_no.
     zewms_uretime_transfer-productno = gs_item-productno.
    
     SELECT SINGLE * FROM makt INTO gs_makt
    
     WHERE matnr EQ zewms_uretime_transfer-productno.
     zewms_uretime_transfer-umlgo = gs_lips-umlgo .
    
     zewms_uretime_transfer-/scwm/stagarbin = gs_item-/scwm/stagarbin.
    
     zewms_uretime_transfer-maktx = gs_makt-maktx .
    
     zewms_uretime_transfer-stock_category = gs_item-stock_category.
    
     zewms_uretime_transfer-kunnr = gs_palet-kunnr .
    
     zewms_uretime_transfer-urt_tar = gs_palet-urt_tar .
    
     zewms_uretime_transfer-urt_saat = gs_palet-urt_saat.
    
     zewms_uretime_transfer-charg = gs_palet-charg .
    
     zewms_uretime_transfer-docid = gs_huref-docid .
    ENDMODULE .
    FORM transfer .
    
     DATA : lt_return TYPE TABLE OF bapiret2,
    
     ls_return TYPE bapiret2.
     IF zewms_uretime_transfer-palet_no IS INITIAL .
    
     MESSAGE 'Palet No bulunamadı' TYPE 'I' DISPLAY LIKE 'E'.
    
     RETURN.
    
     ENDIF .
     IF zewms_uretime_transfer-docid IS INITIAL .
    
     MESSAGE 'Palet DOC ID bulunamadı' TYPE 'I' DISPLAY LIKE 'E'.
    
     RETURN.
    
     ENDIF .
     CALL FUNCTION 'ZEWM_TESLIMAT_GONDER'
    
     EXPORTING
    
     iv_docid = zewms_uretime_transfer-docid
    
     IMPORTING
    
     et_return = lt_return.
     CALL FUNCTION 'FINB_BAPIRET2_DISPLAY'
    
     EXPORTING
    
     it_message = lt_return.
    ENDFORM.
    FUNCTION zewm_teslimat_gonder.
    
    *"----------------------------------------------------------------------
    
    *"*"Local Interface:
    
    *" IMPORTING
    
    *" VALUE(IV_DOCID) TYPE /SCDL/DL_DOCID OPTIONAL
    
    *" EXPORTING
    
    *" VALUE(ET_RETURN) TYPE BAPIRET2_TT
    
    *"----------------------------------------------------------------------
    
     CONSTANTS: lc_aspect TYPE string VALUE '/SCWM/S_SP_A_HEAD',
    
     lc_aspect2 TYPE string VALUE '/SCDL/S_SP_A_HEAD',
    
     lc_action TYPE string VALUE '/SCWM/ACT_POST_GM'.
     DATA : lt_dlv TYPE /scwm/dlv_docid_item_tab,
    
     ls_dlv LIKE LINE OF lt_dlv,
    
     lo_message TYPE REF TO /scdl/cl_dm_message,
    
     lt_message TYPE /scmb/t_messages_int,
    
     ls_message TYPE /scmb/s_messages_int,
    
     lv_raise_exc TYPE boole_d,
    
     lt_inkeys TYPE TABLE OF /scdl/s_sp_k_head,
    
     ls_inkeys TYPE /scdl/s_sp_k_head,
    
     lt_return_codes TYPE /scmb/t_sp_return_code,
    
     lv_rejected TYPE abap_bool,
    
     lt_return TYPE TABLE OF bapiret2,
    
     ls_return TYPE bapiret2,
    
     lo_sp TYPE REF TO /scwm/cl_sp_prd_out, "/scwm/cl_sp_fd. XAAYDIN ANA OBJE DEĞİŞTİRİLDİ
    
     go_handler2 TYPE REF TO /scwm/cl_dlv_handler_adapter,
    
     go_handler3 TYPE REF TO /scmb/cl_message_handler.
     FREE : et_return.
     ls_inkeys-docid = iv_docid ."'0050569918601ED8B4C03480E1FA7111'."'0050569933DD1ED8AFB33A81B086C110'.
    
     APPEND ls_inkeys TO lt_inkeys.
     CREATE OBJECT go_handler2 .
     CREATE OBJECT lo_sp
    
     EXPORTING
    
     iv_mode = /scdl/cl_sp=>sc_mode_classic " 'C'
    
     io_attribute_handler = go_handler2
    
     io_message_handler = go_handler2. " GO_TA_MANAGER->MO_ADAPTER_HANDLER. "mo_adapter_handler.
     CALL METHOD lo_sp->/scmb/if_sp_action~execute
    
     EXPORTING
    
     aspect = lc_aspect
    
     inkeys = lt_inkeys
    
    * inparam =
    
     action = lc_action
    
    * relation_inkey =
    
    * relation =
    
     IMPORTING
    
    * outrecords =
    
     rejected = lv_rejected
    
     return_codes = lt_return_codes
    
    * relation_outrecord =
    
     .
     go_handler3 = go_handler2->mo_msg_handler.
    
     "CALL METHOD go_handler3->display_messages .
     CALL METHOD go_handler3->mt_message_out
    
     IMPORTING
    
     et_message = lt_message.
     LOOP AT lt_message INTO ls_message .
    
     ls_return-type = ls_message-s_msg-msgty." 'S'.
    
     ls_return-id = ls_message-s_msg-msgid."'00'.
    
     ls_return-number = ls_message-s_msg-msgno."'398' .
    
     ls_return-log_msg_no = ls_message-s_msg-msgno."'398'.
    
     ls_return-message_v1 = ls_message-s_msg-msgv1.
    
     ls_return-message_v2 = ls_message-s_msg-msgv2.
    
     ls_return-message_v3 = ls_message-s_msg-msgv3.
    
     ls_return-message_v4 = ls_message-s_msg-msgv4.
    
     APPEND ls_return TO lt_return.
    
     ENDLOOP .
    IF lt_return IS NOT INITIAL .
    
    * CALL FUNCTION 'FINB_BAPIRET2_DISPLAY'
    
    * EXPORTING
    
    * it_message = lt_return.
    
    ELSE.
    
     ls_return-type = 'S'.
    
     ls_return-id = '00'.
    
     ls_return-number = '398' .
    
     ls_return-log_msg_no = '398'.
    
     ls_return-message_v1 = 'Teslimat başarılı' .
    
     "ls_return-message_v2 = 'No lu palet oluşturuldu'.
    
     APPEND ls_return TO lt_return.
    
    ENDIF .
     et_return = lt_return .
     CALL METHOD lo_sp->/scmb/if_sp_transaction~save
    
    * EXPORTING
    
    * synchronously = ABAP_FALSE
    
     IMPORTING
    
     rejected = lv_rejected.
     CASE lv_rejected.
    
     WHEN abap_true .
    
     ROLLBACK WORK.
    
    * Call CLEANUP method of service provider
    
     CALL METHOD lo_sp->/scmb/if_sp_transaction~cleanup
    
     EXPORTING
    
     reason = /scmb/if_sp_transaction=>SC_CLEANUP_END."sc_cleanup_commit.
    
     WHEN abap_false.
    
     COMMIT WORK AND WAIT.
    
     CALL METHOD lo_sp->/scmb/if_sp_transaction~cleanup
    
     EXPORTING
    
     reason = /scmb/if_sp_transaction=>sc_cleanup_commit.
    
     ENDCASE.
    ENDFUNCTION.

    Brgds

    M.Ozgur Unal

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 26, 2018 at 12:01 PM

    Hi all ;

    Developers can use given example for ODO Good issue .

    DATA: lt_inkeys TYPE TABLE OF /SCDL/S_SP_K_HEAD.
    
    DATA: ls_inkeys TYPE /SCDL/S_SP_K_HEAD.
    
    DATA: lt_return_codes    TYPE         /scmb/t_sp_return_code.
    
    DATA: lv_rejected        TYPE         abap_bool.
    
    ls_inkeys-docid  = '0050569933DD1ED8AFB33A81B086C110'.
    
    APPEND ls_inkeys TO lt_inkeys.
    
    
    
    CONSTANTS: lc_aspect TYPE string VALUE '/SCWM/S_SP_A_HEAD',
    
               lc_aspect2 TYPE string VALUE '/SCDL/S_SP_A_HEAD',
    
               lc_action TYPE string VALUE '/SCWM/ACT_POST_GM'.
    
    
    DATA: lo_sp TYPE REF TO /SCWM/CL_SP_FD.
    
    DATA: ls_inparam TYPE CHAR4.
    
    DATA: ls_RELATION_INKEY TYPE CHAR4.
    
    DATA: lv_RELATION TYPE string.
    
    
    ************************************************************************
    
    CREATE OBJECT lo_sp.
    
    CALL METHOD lo_sp->/scmb/if_sp_action~execute
    
      EXPORTING
    
        aspect             = lc_aspect
    
        inkeys             = lt_inkeys
    
    *    inparam            =
    
        action             = lc_action
    
    *    relation_inkey     =
    
    *    relation           =
    
       IMPORTING
    
    *    outrecords         =
    
         rejected           = lv_rejected
    
         return_codes       = lt_return_codes.
    
    
    CALL METHOD lo_sp->/SCMB/IF_SP_TRANSACTION~SAVE
    
    *   EXPORTING
    
    *     synchronously = ABAP_FALSE
    
       IMPORTING
    
         rejected      = lv_rejected .
    
    
        CASE lv_rejected.
    
          WHEN abap_false.
    
            COMMIT WORK AND WAIT.
    
    *       Call CLEANUP method of service provider
    
            CALL METHOD lo_sp->/scmb/if_sp_transaction~cleanup
    
              EXPORTING
    
                reason = /scmb/if_sp_transaction=>sc_cleanup_commit.
    
          WHEN abap_true.
    
            ROLLBACK WORK.
    
            CALL METHOD lo_sp->/scmb/if_sp_transaction~cleanup
    
              EXPORTING
    
                reason = /scmb/if_sp_transaction=>sc_cleanup_commit.
    
        ENDCASE.
    
    
    
    
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 17, 2018 at 11:33 AM

    Hi Mehmet,

    /scwm/cl_goods_movement=>post_dlv

      ls_dlv-docid = iv_docid.
      ls_dlv-doccat = iv_doccat.
      APPEND ls_dlv TO lt_dlv.
      /scwm/cl_goods_movement=>post_dlv(
        EXPORTING
          it_dlv      = lt_dlv
          iv_gmcat    = /scwm/if_docflow_c=>sc_gi
        IMPORTING
           eo_message = lo_message ).
    

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.