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

issue with code for idoc

Former Member
0 Likes
732

Hi,

I have an idoc for which the edids-STATXT CA '&',but the edids-stamno is 0.

my intention is to get the description i.e edids-statxt

so for few idoc i have edids-staxt = &&&&but since the stamno is 0, i am getting an error from

FM MESSAGE_PREPARE SAYING MESSAGE 000 IS NOT DEFINED IN LANG EN AND WA.

loop at itab.

SELECT SINGLE * FROM EDIDS INTO WA_EDIDS WHERE DOCNUM = ITAB-IDOC

AND COUNTR = ITAB-STATUS_COUNTER.

IF WA_EDIDS-STATXT CA '&'.

V_MSGNO = WA_EDIDS-STAMNO.

CALL FUNCTION 'MESSAGE_PREPARE'

EXPORTING

msg_id = WA_EDIDS-STAMID

msg_no = V_MSGNO

MSG_VAR1 = WA_EDIDS-STAPA1

MSG_VAR2 = WA_EDIDS-STAPA2

MSG_VAR3 = WA_EDIDS-STAPA3

MSG_VAR4 = WA_EDIDS-STAPA4

IMPORTING

MSG_TEXT = itab-descrp.

CONDENSE ITAB-DESCRP.

ELSE .

ITAB-DESCRP = WA_EDIDS-STATXT.

ENDIF.

modify itab.

endloop.

loop at itab.

if itab-descrp is initial.

select single descrp from teds2 into itab-descrp

where status = itab-STATUS AND

LANGUA = 'E'.

endif.

MODIFY ITAB.

clear itab.

endloop.

LET ME KNOW

Thanks

4 REPLIES 4
Read only

Former Member
0 Likes
539

Hi

U should check if it exists a message number 000 for the class indicated in WA_EDIDS-STAMID.

U can use trx SE91

Max

Read only

0 Likes
539

Hi,

FOR THAT RECORD WA_EDIDS-STAMID IS BLANK

WHAT DOES WA_EDIDS-STAMID. REFER TO .

THANKS

Read only

ferry_lianto
Active Contributor
0 Likes
539

Hi,

WA_EDIDS-STAMID refers to SY-MSGID.

Regards

Ferry Lianto

Read only

0 Likes
539

Hi

I have made the foloowing changes which shows as added.

all i want in the itab-descrp is the message in status record.

if you have any messgae below the staus then i need that , if you don't have any mess below the status numeber then i need the message which is beside the no.

note the diffenece is below and beside.

loop at itab.

SELECT SINGLE * FROM EDIDS INTO WA_EDIDS WHERE DOCNUM = ITAB-IDOC

AND COUNTR = ITAB-STATUS_COUNTER.

IF WA_EDIDS-STATXT CA '&'.

V_MSGNO = WA_EDIDS-STAMNO.

if v_msgno ne '000'.----


added

CALL FUNCTION 'MESSAGE_PREPARE'

EXPORTING

msg_id = WA_EDIDS-STAMID

msg_no = V_MSGNO

MSG_VAR1 = WA_EDIDS-STAPA1

MSG_VAR2 = WA_EDIDS-STAPA2

MSG_VAR3 = WA_EDIDS-STAPA3

MSG_VAR4 = WA_EDIDS-STAPA4

IMPORTING

MSG_TEXT = itab-descrp.

CONDENSE ITAB-DESCRP.

endif.----


added

ELSE .

ITAB-DESCRP = WA_EDIDS-STATXT.

ENDIF.

modify itab.

endloop.

loop at itab.

if itab-descrp is initial.

select single descrp from teds2 into itab-descrp

where status = itab-STATUS AND

LANGUA = 'E'.

endif.

MODIFY ITAB.

clear itab.

endloop.

let me know if this works

Thanks