Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

GN_DELIVERY_CREATE for outbound using PO

I need to create an outbound delivery by PO using FM GN_DELIVERY_CREATE. Has anyone used this FM before and does anyone have some sample code for it. Thank you

Tags:
Former Member
Former Member replied

hi

good

go through this link

http://translate.google.com/translate?hl=en&sl=es&u=http://www.abap.es/centro_IDOCS_practica_curso.htm&sa=X&oi=translate&resnum=4&ct=result&prev=/search%3Fq%3DGN_DELIVERY_CREATE,SAP%26hl%3Den

check this code too

&----


*& Report ZSAN_BAPI_GOODSMVT_CREATE *

*& *

&----


*& *

*& *

&----


REPORT ZSAN_BAPI_GOODSMVT_CREATE .

DATA: GOODSMVT_HEADER LIKE BAPI2017_GM_HEAD_01,

" Material Document Header Data

GOODSMVT_CODE LIKE BAPI2017_GM_CODE,

" Assign code to transaction for BAPI goods movement

MATERIALDOCUMENT LIKE BAPI2017_GM_HEAD_RET-MAT_DOC,

" Number of Material Document

GOODSMVT_ITEM LIKE BAPI2017_GM_ITEM_CREATE OCCURS 0 WITH HEADER LINE,

" Create Material Document Item

RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE

" Return table for messages

.

*Fill values in header

GOODSMVT_HEADER-PSTNG_DATE = '20030825'.

GOODSMVT_HEADER-DOC_DATE = '20030802'.

*Fill GOODSMVT_CODE

GOODSMVT_CODE-GM_CODE = '05' .

*Fill Item Table

GOODSMVT_ITEM-MATERIAL = '100-100'.

GOODSMVT_ITEM-PLANT = '1000'.

GOODSMVT_ITEM-STGE_LOC = '0001'.

GOODSMVT_ITEM-MOVE_TYPE = '501'.

GOODSMVT_ITEM-ENTRY_QNT = '50'.

GOODSMVT_ITEM-ITEM_TEXT = 'Test Sanket'.

*GOODSMVT_ITEM-COSTCENTER = '1000'.

APPEND GOODSMVT_ITEM.

*Create Good's movement

CALL FUNCTION 'BAPI_GOODSMVT_CREATE'

EXPORTING

GOODSMVT_HEADER = GOODSMVT_HEADER

GOODSMVT_CODE = GOODSMVT_CODE

IMPORTING

MATERIALDOCUMENT = MATERIALDOCUMENT

TABLES

GOODSMVT_ITEM = GOODSMVT_ITEM

RETURN = RETURN.

*Commit BAPI

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = 'X'.

*Display Goods movement number

FORMAT COLOR 6 INVERSE ON.

READ TABLE RETURN WITH KEY TYPE = 'E'.

IF SY-SUBRC = 0.

WRITE: /,'ERROR! Goods movement not created'.

ELSE.

WRITE: /,'Goods movent number',MATERIALDOCUMENT COLOR 5,

'posted for material',GOODSMVT_ITEM-MATERIAL.

ENDIF.

FORMAT COLOR OFF INVERSE OFF.

reward point if helpful.

thanks

mrutyun^

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question