cancel
Showing results for 
Search instead for 
Did you mean: 

hiii- urgent

Former Member
0 Kudos

hii i am a new employee.

can anyone please explain wat the following code is doing

IF sy-subrc = 0.

l_mstring = t100-text.

IF l_mstring CS '&1'.

REPLACE '&1' WITH wa_messtab-msgv1 INTO l_mstring.

REPLACE '&2' WITH wa_messtab-msgv2 INTO l_mstring.

REPLACE '&3' WITH wa_messtab-msgv3 INTO l_mstring.

REPLACE '&4' WITH wa_messtab-msgv4 INTO l_mstring.

ELSE.

REPLACE '&' WITH wa_messtab-msgv1 INTO l_mstring.

REPLACE '&' WITH wa_messtab-msgv2 INTO l_mstring.

REPLACE '&' WITH wa_messtab-msgv3 INTO l_mstring.

REPLACE '&' WITH wa_messtab-msgv4 INTO l_mstring.

ENDIF.

CONDENSE l_mstring.

i am supposed to use a function module for it

i have got a function module.

but i am not understanding wat fields shd i put in it

the function module is

CALL FUNCTION 'MESSAGE_TEXT_BUILD'

EXPORTING

msgid =

msgnr =

  • MSGV1 = ' '

  • MSGV2 = ' '

  • MSGV3 = ' '

  • MSGV4 = ' '

  • IMPORTING

  • MESSAGE_TEXT_OUTPUT =

can anyone tell wat shd i put on msgid ,msgnr and other fields.

saurabh102@gmail.com

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Saurabh,

1. In this code it first checks whether the variable l_mstring contains string '&1'.

<b>If yes,</b>

Then replace '&1' in variable l_mstring with the field msgv1 of work area wa_messtab,

replace '&2' in variable l_mstring with the field msgv1 of work area wa_messtab

replace '&3' in variable l_mstring with the field msgv1 of work area wa_messtab

replace '&4'in variable l_mstring with the field msgv1 of work area wa_messtab

<b>If no</b>

Then replace '&'in variable l_mstring with the field msgv1, msgv2,msgv3,msgv4 of work area wa_messtab.

then all the leading blanks in the variable l_mstring is removed using condense statement.

Regards,

Reward if useful,

Supriya

former_member196398
Active Contributor
0 Kudos

Saurabh,

Suggest you to please post this to ABAP forum for Immediate response,

Regards,

Prasobh