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

Populating Values onto Selection Screen

Former Member
0 Likes
1,061

Hi Experts,

Need help in the below,

I need to change the values of second selection screen based on first selection screen Data from Ztable.

1st selection screen is having Mat Doc num,

2nd selection screen is having some address...

Both are saved in one Ztable.

Now based on Mat doc entered in 1st selc scrn, I need to change 2nd selc scrn data from Ztable.

If possible help me with example..

Pls Note: This is Printprogram for smartform.. Do not suggest me ALV exmaple

Edited by: Praveen Sanjeev on May 12, 2011 9:52 AM

11 REPLIES 11
Read only

Former Member
0 Likes
1,016

Dear Praveen,

You can put different fields in same selection screen and hide/display based on conditions. Try this code.

PARAMETERS : psel TYPE matnr .

PARAMETERS : p_secnd TYPE matnr MODIF ID bl1.

PARAMETERS : p_first TYPE ebeln MODIF ID bl2.

initialization.

LOOP AT SCREEN.

IF screen-group1 = 'BL1'

or screen-group1 = 'BL2'.

screen-active = 0.

MODIFY SCREEN.

ELSE.

screen-active = 1.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

AT SELECTION-SCREEN OUTPUT.

IF psel = '000000000000000061'. "Some value

LOOP AT SCREEN.

IF screen-group1 = 'BL1'.

screen-active = 0.

MODIFY SCREEN.

ELSE.

screen-active = 1.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

IF psel = '000000000000000062'. "Some value

LOOP AT SCREEN.

IF screen-group1 = 'BL2'.

screen-active = 0.

MODIFY SCREEN.

ELSE.

screen-active = 1.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

Regards,

Aditya

Read only

0 Likes
1,016

Hi,

I am not hiding the fields here. I need to populate the data from Ztable on the selection screen fields.

Thanks

Praveen

Read only

0 Likes
1,016

Hi Praveen Sanjeev,

I think you got the soultion as mention by Dande

Otherwise you can create composite search help for that but every time you have to select value from search help i think this wll not good solution.

Read only

0 Likes
1,016

Hi Ravishankar,

As per Dande we can just store the data into parameter variable called p_ersda. But we can't reflect it onto selection screen.

I need that logic to show the data onto selection screen.

Thanks

Praveen

Read only

0 Likes
1,016

Hi,

After entering the value, you need to press enter. then only value will be populated.

Regards

Dande

Read only

0 Likes
1,016

Hi Dande,

Thanks for the Solution.

I got the Idea. And I have done with it as below..

AT SELECTION-SCREEN.

CLEAR : wa_initial.

SELECT SINGLE * INTO wa_initial FROM zmm_dlvnote WHERE matdoc = pmblnr.

IF sy-subrc = 0.

MESSAGE 'Entered Material Document No is already exist' TYPE 'I'.

LEAVE TO SCREEN 1000.

ENDIF.

AT SELECTION-SCREEN OUTPUT.

name = wa_initial-name2.

strhno = wa_initial-strhno.

city = wa_initial-city.

.

.

.

Read only

pawan_rai
Participant
0 Likes
1,016

Hi,

Your Requirement can be fulfilled using CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

Pass the retfield as DATA : it_return1 LIKE ddshretval OCCURS 0 WITH HEADER LINE.

After the call function pass the it_return1-fieldval the parameter of theselection-screen .

In selection screen once you enter the mat_doc and press enter you will get the address for that particular material document.

Regards,

Pawan.

Read only

ravi_lanjewar
Contributor
0 Likes
1,016

Hi,

Your sequence to executing the screen is not define. you are using the subscreen or 2 different screen.

Expalin you problem more details

Read only

0 Likes
1,016

Hi,

As I mentioned earlier, there are two different screen Block b1, Block b2.

Please let me know if you need any more information onthe same.

Read only

Former Member
0 Likes
1,016

Hi,

Please check the below code.

parameters p_matnr type MATNR.

parameters p_ersda type ersda.

at selection-screen output.

if p_matnr is not initial.

select single ersda into p_ersda

from mara

where matnr = p_matnr.

endif.

Regards

Dande

Read only

pawan_rai
Participant
0 Likes
1,016

Hi,

Have you tried it using CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'?

Regards,

Pawan