‎2011 May 12 5:19 AM
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
‎2011 May 12 6:11 AM
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
‎2011 May 12 7:31 AM
Hi,
I am not hiding the fields here. I need to populate the data from Ztable on the selection screen fields.
Thanks
Praveen
‎2011 May 12 9:21 AM
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.
‎2011 May 12 10:58 AM
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
‎2011 May 12 11:17 AM
Hi,
After entering the value, you need to press enter. then only value will be populated.
Regards
Dande
‎2011 May 12 11:54 AM
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.
.
.
.
‎2011 May 12 6:24 AM
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.
‎2011 May 12 6:41 AM
Hi,
Your sequence to executing the screen is not define. you are using the subscreen or 2 different screen.
Expalin you problem more details
‎2011 May 12 7:29 AM
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.
‎2011 May 12 7:42 AM
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
‎2011 May 12 11:03 AM
Hi,
Have you tried it using CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'?
Regards,
Pawan