BAPI - Material Save Data
BAPI - Material Save Data
BAPI - Material Save Data
*&---------------------------------------------------------------------*
*& Selection Screen Declarations
*&---------------------------------------------------------------------*
SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-b01.
PARAMETERS : p_fname TYPE rlgrap-filename,
p_header TYPE i DEFAULT 1.
SELECTION-SCREEN : END OF BLOCK b1.
START-OF-SELECTION .
w_fname = p_fname.
DO p_header TIMES.
DELETE it_bapi INDEX 1.
ENDDO.
clear : wa_headdata,
wa_palntdatax,
wa_plantdata.
"wa_text .
LOOP AT it_bapi INTO w_bapi.
* wa_headdata-material = w_bapi-matnr .
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = w_bapi-matnr
IMPORTING
output = wa_headdata-material.
wa_headdata-purchase_view = 'X'.
wa_plantdata-plant = w_bapi-werks .
wa_palntdatax-plant = w_bapi-werks .
wa_text-applobject = 'MATERIAL'.
wa_text-text_name = wa_headdata-material.
* wa_text-text_name = w_bapi-matnr .
wa_text-text_id = 'BEST'.
wa_text-langu = sy-langu .
wa_text-text_line = w_bapi-text .
CLEAR : wa_text .
refresh : it_text .
ENDLOOP.
ENDIF.
****************************************ERROR MSG*********************
LOOP AT it_return.
WRITE / it_return-message.
ENDLOOP.