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

Replacing internal table values with selection screen parameters

Former Member
0 Likes
438

I have a ITAB1 i need to replace the contents of itab with selection parameters detail explanation as below

itab contains following values of field ATEXT

VR:MM_PURCH_REL_O_POXX

VR:TEMPLATE_MM_MATMA_MNT_X

VR:TEMPLATE_SC_XPLNT_MNT_X

selection screen parameters will be 1 and 3 these are the trade indicators indicator corresponds to the values like

1 is B

3 is M

i need to replace _X from the above examples with these indicators

again , i need to replace TEMPLATE from the above example with the content of another ITAB2 with the following field (SBU) values are

SBU_1

SBU_2

solution required urgently

useful suggestions will be rewarded.

tanks and regards

venky

3 REPLIES 3
Read only

Former Member
0 Likes
413

Hi Venky Neela,

For replacing _X with B or M first u need to get the value into the string and u need to calculate the string length.

u need to check the last 2 charecters are '_X' or not.

if the last two charecters '_X', by using offset u need to replace with B or M.

U need to check the selection screen parameters. depending on that u need to write if condition and replace the last 2 charecters.

I din't understand from this part

again , i need to replace TEMPLATE from the above example with the content of another ITAB2 with the following field (SBU) values are

SBU_1

SBU_2

Best regards,

raam

Read only

Former Member
0 Likes
413

hi kodandaram,

tanks for u r reply

i need to replace always at the end _X with wat i m selected in selection screen parameters

VR:MM_PURCH_REL_O_POXX

VR:TEMPLATE_MM_MATMA_MNT_X

VR:TEMPLATE_SC_XPLNT_MNT_X

and also i need to replace the template in above values with another internal table contents

the itab consist sbu1 and sbu2

the selection screen parameter will be 1 and 3

the output should be like this

VR:SBU1_MM_MATMA_MNT_1

VR:SBU2_MM_MATMA_MNT_1

VR:SBU1_MM_MATMA_MNT_3

VR:SBU2_MM_MATMA_MNT_3

I hope u understand this

please revert back

tank you

Read only

0 Likes
413

Hi,

As i said before first we need to get the value into the charecter variable and u need to calculate the string length because at waht position we get this '_X'.

after finding the string length u need to use off set to replace '_X'.

for example if length of the string VR:TEMPLATE_MM_MATMA_MNT_X is 26, then u need to use logic var+24(2) = 1 or 3.

To find the string length use STRLEN Command.

in the same way u need to do for the the TEMPLETE also

Please revert back if u need help

reward if helpful

raam