Steps
- To find BAPI , go to transaction code BAPI.
DATA : RETURN LIKE BAPIRETURN,
WA_INFO TYPE BAPISDSTAT,
IT_INFO TYPE TABLE OF BAPISDSTAT.
PARAMETERS : P_VBELN TYPE VBAK-VBELN.
CALL FUNCTION 'BAPI_SALESORDER_GETSTATUS'
EXPORTING
SALESDOCUMENT = P_VBELN
IMPORTING
RETURN = RETURN
TABLES
STATUSINFO = IT_INFO
.
IF RETURN IS INITIAL.
WRITE : / 'Doc Number' COLOR 3 , 20 'PO Number' , 40 'Status',
50 'DelV Status ' , 65 'Items' , 80 'Material' ,
90 'Net Price' COLOR 6.
WRITE : / SY-ULINE(100).
LOOP AT IT_INFO INTO WA_INFO.
WRITE : / WA_INFO-DOC_NUMBER ,
20 WA_INFO-PURCH_NO,
40 WA_INFO-PRC_STAT_H,
50 WA_INFO-DLV_STAT_H,
65 WA_INFO-ITM_NUMBER,
80 WA_INFO-MATERIAL,
90 WA_INFO-NET_PRICE LEFT-JUSTIFIED.
ENDLOOP.
ELSE.
WRITE : / RETURN-MESSAGE.
ENDIF.
No comments:
Post a Comment