Application Development 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: 

internal table update

Former Member
0 Kudos
86

hi

i have two internal tables

1 isthe internal table treturn from bapi_goodsmovmt which has error messages

i need to send this error msgs to tmsg table of the function module SO_NEW_DOCUMENT_ATT_SEND_API1

but when i send the msgs to tmsg it should deffrentiate the msgs for diffrent items

for example

item 1

list all the errors

item2

list all the errors

because there may be many items for a po

can any one suggest me how to do

7 REPLIES 7

Former Member
0 Kudos
56

Hi,

It depends on how the bapi returns the error messages..

Does it send the errors for each line item if there is one...

If so how does it pass...Meaning in which field in the return structure it is passing the line item...

Thanks,

Naren

0 Kudos
56

in bapi return table there is a field called as row in thant it is sending the item no with the errors

Former Member
0 Kudos
56

Hi,

Check this example..

DATA: T_RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE.

  • code this after the BAPI CALL and assuming the messages will be in the internal table T_RETURN..

DATA: T_RETURN_TMP LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE.

T_RETURN_TMP[] = T_RETURN[].

SORT T_RETURN_TMP BY ROW.

DELETE ADJACENT DUPLICATES FROM T_RETURN_TMP

COMPARING ROW.

LOOP AT T_RETURN_TMP.

  • POPULATE THE LINE ITEM.

TMSG-MESSAGE = T_RETURN_TMP-ROW.

APPEND TMSG.

TMSG-MESSAGE = '----


'.

APPEND TMSG.

LOOP AT T_RETURN WHERE ROW = T_RETURN_TMP-ROW.

  • POPULATE THE ERROR.

TMSG-MESSAGE = T_RETURN-MESSAGE.

APPEND TMSG.

ENDLOOP.

  • APPEND A BLANK LINE.

APPEND INITIAL LINE TO TMSG.

ENDLOOP.

Hope this helps..

Thanks,

Naren

0 Kudos
56

HI NAREN THANKS FOR REPLY

BUT IF IHAVE 3 ITEMS 10,20 AND 30 AND IN THE RETURN TABLE ROW I WILL GET AS 1 FOR 1ST ITEM AND 2 FOR 2ND AND 3 FOR 3RD

BUT HOW CAN I USE THE CONDITION ROW = ITEMS-EBELP

CAN U SEND ME THE SOLUTION

0 Kudos
56

HI NAREN ANY SUGGESTIONS

0 Kudos
56

HI NAREN IN THE ROW OF RETURN TABLE I AM GETTING THE ROW NUMBER OF THE ITEM CAN U SUGGEST ME HOW SHOULD I LINK THEM

Former Member
0 Kudos
56

Hi

Why do you want to link back to the PO table??Is that a requirement for you...

Thanks,

Naren