‎2006 Nov 06 9:57 PM
I have an internal table with a record with fields:
Text: Change delivery &1 , customer &2 (of type char 73)
msgv1: 5678 (of char 50)
msgv2: 457890 (of char 50)
Now I want to replace &1 with msgv1 and &2 with msgv2 values. I tried the following code:
LOOP AT itab.
IF itab-msgv1 NE space.
REPLACE '&1' WITH itab-msgv1 INTO itab-text.
CONDENSE itab-text.
MODIFY itab.
ENDIF.
IF itab-msgv2 NE space.
REPLACE '&2' WITH itab-msgv2 INTO itab-text.
CONDENSE itab-text.
MODIFY itab.
ENDIF.
endloop.
Now when I set breakpoint and see after the loop, that record in itab-text contains value:
Change delivery 5678
(where as I could nt find any replacement for customer &2 and not even the original text customer &2). Am I doing anything wrong?
Can you please suggest/correct the code here reg. correct complete replacements?
Thanks.
‎2006 Nov 06 10:03 PM
Hi,
If you know the message ID and number..
Use the function module MESSAGE_PREPARE with the parameters MSGID, MSGNO, MSGV1 , MSGV2 , MSGV3, MSGV4.
I will also check your code..
Thanks,
Naren
‎2006 Nov 06 10:03 PM
Hi,
If you know the message ID and number..
Use the function module MESSAGE_PREPARE with the parameters MSGID, MSGNO, MSGV1 , MSGV2 , MSGV3, MSGV4.
I will also check your code..
Thanks,
Naren
‎2006 Nov 06 10:05 PM
Hi,
Try to condense the field itab-msgv1, itab-msgv2 before doing the concatenate..
LOOP AT itab.
IF itab-msgv1 NE space.
<b>CONDENSE itab-msgv1.</b>
REPLACE '&1' WITH itab-msgv1 INTO itab-text.
CONDENSE itab-text.
MODIFY itab.
ENDIF.
IF itab-msgv2 NE space.
<b>CONDENSE itab-msgv2.</b>
REPLACE '&2' WITH itab-msgv2 INTO itab-text.
CONDENSE itab-text.
MODIFY itab.
ENDIF.
endloop.
Thanks,
Naren