2008 Mar 21 2:54 PM
Hi experts!
is there any bapi or function module availble to do PGI (POST GOODS ISSUE) and to create Billing Document (invoicing).
Thanks in advance
2008 Mar 22 6:48 AM
Hi use below FM
WS_DELIVERY_UPDATE or 'WS_DELIVERY_UPDATE'_2 to create PGI and update delivery
sample code below.
CALL FUNCTION 'WS_DELIVERY_UPDATE'
EXPORTING
VBKOK_WA = I_VBKOK
SYNCHRON = 'X'
NO_MESSAGES_UPDATE = ' '
UPDATE_PICKING = 'X'
COMMIT = ' '
DELIVERY =
NICHT_SPERREN = 'X'
IF_ERROR_MESSAGES_SEND_0 = 'X'
TABLES
PROT = I_PROTT
EXCEPTIONS
ERROR_MESSAGE = 1
OTHERS = 2.
IF SY-SUBRC 0.
ROLLBACK WORK.
ELSE.
COMMIT WORK.
ENDIF.
and to create invoice use fm RV_INVOICE_CREATE.
for these FM check where used list you will get an idea about what parameter to be passed to these fm
Thanks,
Pavan
2008 Mar 21 4:25 PM
You can use the BAPI - BAPI_BILLING_DOCUMENT_CREATEMULTIPLE for billing document create.
You can try with the BAPI - BAPI_GOODSMVT_CREATE for the post goods issue.
Thanks,
Srinivas
2008 Mar 22 6:48 AM
Hi use below FM
WS_DELIVERY_UPDATE or 'WS_DELIVERY_UPDATE'_2 to create PGI and update delivery
sample code below.
CALL FUNCTION 'WS_DELIVERY_UPDATE'
EXPORTING
VBKOK_WA = I_VBKOK
SYNCHRON = 'X'
NO_MESSAGES_UPDATE = ' '
UPDATE_PICKING = 'X'
COMMIT = ' '
DELIVERY =
NICHT_SPERREN = 'X'
IF_ERROR_MESSAGES_SEND_0 = 'X'
TABLES
PROT = I_PROTT
EXCEPTIONS
ERROR_MESSAGE = 1
OTHERS = 2.
IF SY-SUBRC 0.
ROLLBACK WORK.
ELSE.
COMMIT WORK.
ENDIF.
and to create invoice use fm RV_INVOICE_CREATE.
for these FM check where used list you will get an idea about what parameter to be passed to these fm
Thanks,
Pavan
2008 Apr 28 3:08 AM
hi pavan,
after doing the PGI i want to catch the material document number for that Post Goods Issued delivey order , how can i catch the material document number plz help me....,
jana
2008 Apr 28 3:26 PM
Hi jana!
use this to catch md number.
CALL FUNCTION 'WS_DELIVERY_UPDATE'
EXPORTING
VBKOK_WA = LS_VBKOK
SYNCHRON = 'X'
COMMIT = 'X'
IF_GET_DELIVERY_BUFFERED = 'X'
DELIVERY = ITAB_HEAD-VGBEL
UPDATE_PICKING = 'X'
NICHT_SPERREN = 'X'
IF_ERROR_MESSAGES_SEND_0 = ' '
IMPORTING
EF_ERROR_ANY_0 = LF_ERROR_ANY
TABLES
VBPOK_TAB = LT_VBPOK_TAB
PROT = LT_PROT
EXCEPTIONS
ERROR_MESSAGE = 1
OTHERS = 2.
IF SY-SUBRC = 0.
WAIT UP TO '0.005' SECONDS.
CLEAR VBFA-VBELN.
SELECT SINGLE VBELN INTO VBFA-VBELN FROM VBFA
WHERE VBELV = ITAB_HEAD-VGBEL
AND ERDAT = SY-DATUM
AND VBTYP_N = 'R'.
thanks
jawad