Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

hi

Former Member
0 Likes
292

hello abapers ...

i am trying to create a report on purchase orders using bapi ... i ve done with a piece of codeing ,,, can u plese check it n let me known weather its correct .. if its wrong please do give me the correct codeing .. i am new to bapi with conceptual knowledge in it ..

this is my codeing ..

DATA : BEGIN OF ITAB1 OCCURS 0 .

INCLUDE STRUCTURE BAPIEKKO .

DATA : END OF ITAB1 .

data : wa type

DATA : BEGIN OF ITAB2 OCCURS 0 .

INCLUDE STRUCTURE BAPIEKPO .

DATA : END OF ITAB2 .

DATA : RETURN TYPE BAPIRETURN OCCURS 0 WITH HEADER LINE .

SELECTION-SCREEN BEGIN OF BLOCK A1 WITH FRAME TITLE TEXT-001.

PARAMETERS : PO_NO LIKE BAPIEKKO-PO_NUMBER ,

CO_COM LIKE BAPIEKKO-CO_CODE .

SELECTION-SCREEN END OF BLOCK A1.

INITIALIZATION .

PO_NO = '3000000317'.

CO_COM = '3000' .

START-OF-SELECTION .

CALL FUNCTION 'BAPI_PO_GET_LIST'

thank u in advance

  • EXPORTING

  • REL_GROUP =

  • REL_CODE =

  • ITEMS_FOR_RELEASE = 'X'

TABLES

PO_HEADERS = ITAB1

  • PO_ADDRESSES =

  • PO_ADDRESSES_NEW =

PO_ITEMS = ITAB2

RETURN = RETURN

  • EXCEPTIONS

  • REL_CODE_MISSING = 1

  • REL_AUTHORITY_CHECK_FAILED = 2

  • OTHERS = 3

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

LOOP AT ITAB1 .

WRITE : / ITAB1-PO_NUMBER , ITAB1-CO_CODE , ITAB1-DOC_CAT ,

ITAB1-DOC_TYPE, ITAB1-STATUS , ITAB1-VENDOR , ITAB1-PURCH_ORG ,

ITAB1-PUR_GROUP , ITAB1-DOC_DATE ,

ITAB1-REL_GROUP , ITAB1-REL_IND , ITAB1-REL_STATUS .

ENDLOOP .

1 REPLY 1
Read only

Former Member
0 Likes
269

As simple as that usha..Just compare the result with the database with normal coding part..if you getting the same data what is present in Database then you are obsolutly wright ..

Reward points if useful

regards

Sas