‎2006 Oct 21 12:10 AM
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
‎2006 Oct 21 12:13 AM
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
‎2006 Oct 21 12:17 AM
in bapi return table there is a field called as row in thant it is sending the item no with the errors
‎2006 Oct 21 12:25 AM
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
‎2006 Oct 21 12:48 AM
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
‎2006 Oct 21 12:53 AM
‎2006 Oct 21 1:09 AM
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
‎2006 Oct 21 1:27 AM
Hi
Why do you want to link back to the PO table??Is that a requirement for you...
Thanks,
Naren