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

Problem reading a parameters content

Former Member
0 Likes
484

Hello,

I have a problem with reading a parameters content.

Following coding:

...

...

  • Log table

DATA: BEGIN OF it_log OCCURS 0,

matnr_short(10),

matnr TYPE matnr,

END OF it_log.

...

...

PARAMETERS s_matnr TYPE rmmg1-matnr.

...

...

Now I enter numbers like 1234000000, 1235000000, 1236000000.

Content of s_matnr will be 000000001234000000, etc.

Q: How can I read all entries of s_matnr into it_log-matnr ?

2.Q: How can I read 1234000000 to it_log-matnr_short ?

Thanks a lot!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
439

Hi,

we can use only one value at a time if we are using Parameters

see the following example

tables:BKPF.

Parameters : P_Bukrs type BKPF-bukrs.

Select-options : S_Bukrs for BKPF-bukrs.

using select-options we are creating an internal table with the values needed from user..but using parameter only a single variable is fetched from user

in short

PARAMETERS s_matnr TYPE rmmg1-matnr.

Now I enter numbers like 1234000000, 1235000000, 1236000000.

Content of s_matnr will be 000000001234000000, etc. <u><i><b> NO</b></i></u>

For this declare as following

tables:matnr.

Select-options : s_matnr for rmmg1-matnr.

we can check the values entered in select options during a select statement like

select * from MARA into XXXX where

...................... and matnr in s-Matnr.

so the internal table will contain values from select which has matnr in the s_matnr.

Q: How can I read all entries of s_matnr into it_log-matnr ?

2.Q: How can I read 1234000000 to it_log-matnr_short ?

since the value is available in s_matnr itself pls can you clarify the purpose of again reading it to another internal table

Pls check,revert and reward if helpful

Regards

Byju

2 REPLIES 2
Read only

Former Member
0 Likes
440

Hi,

we can use only one value at a time if we are using Parameters

see the following example

tables:BKPF.

Parameters : P_Bukrs type BKPF-bukrs.

Select-options : S_Bukrs for BKPF-bukrs.

using select-options we are creating an internal table with the values needed from user..but using parameter only a single variable is fetched from user

in short

PARAMETERS s_matnr TYPE rmmg1-matnr.

Now I enter numbers like 1234000000, 1235000000, 1236000000.

Content of s_matnr will be 000000001234000000, etc. <u><i><b> NO</b></i></u>

For this declare as following

tables:matnr.

Select-options : s_matnr for rmmg1-matnr.

we can check the values entered in select options during a select statement like

select * from MARA into XXXX where

...................... and matnr in s-Matnr.

so the internal table will contain values from select which has matnr in the s_matnr.

Q: How can I read all entries of s_matnr into it_log-matnr ?

2.Q: How can I read 1234000000 to it_log-matnr_short ?

since the value is available in s_matnr itself pls can you clarify the purpose of again reading it to another internal table

Pls check,revert and reward if helpful

Regards

Byju

Read only

Former Member
0 Likes
439

Hi Wolf,

Sorry, your question is not clear but still check my small example it may be useful.

Tables: MARA.

*Declaring the internal table

DATA: Begin of it_mara occurs 0,

matnr like mara-matnr,

mbrsh like mara-mbrsh,

end of it_mara.

*parameter is used for selecting single value only

parameter: s_matnr like mara-matnr.

*If you are using parameter the select stament should be

select matnr mbrsh from mara into table it_mara where matnr eq s_matnr.

*now print the values retrived in the internal table

write: / it_mara-matnr, it_mara-mbrsh.

*using select-options u can retirve range of values

select-options: s_matnr for mara-matnr.

*select statement if you use select-options

select matnr mbrsh from mara into table it_mara where matnr in s_matnr.

*printing the values from internal table

write: / it_mara-matnr, it_mara-mbrsh.

SEE THE DIFFERNCE IN THE SELECT STATEMENT IN THIS WAY WE READ THE CONTENTS OF INPUT FIELD

<b>reward with points if useful</b>

cheers,

sunil kumar.