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

Selection Screen - values selection based on 2 blocks

Former Member
0 Likes
1,465

Hi experts,

                  Am an entery-level ABAPer.

                 I have 2 blocks in selection screen as shown in the attachment.

1st block - (Fields from PLAF table)

2nd block - (Fields from MARC table).

Common fields in these 2 tables are Material No(MATNR),MRP Controller(DISPO).

Now,

1) if I give inputs in 1st & 2nd block , 4 field values from 1st block needs to be selected and copied to an internal table where 1st table's MATNR and DISPO Equals MATNR and DISPO of the 2nd table(DISPO is a select option field in 2nd block)..

2)If I give inputs only in 2nd block, same logic as mentioned above.

3)If I give inputs only in 1st block , 4 fields' values should be retrieved from table PLAF and moved to my internal table.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.

SELECT-OPTIONS : s_paart FOR plaf-paart,  "Order Type
                 s_plwrk FOR plaf-plwrk,  "Plant
                 s_matnr FOR plaf-matnr,  "Material
                 s_plnum FOR plaf-plnum.  "Planned Order Number
SELECTION-SCREEN END OF BLOCK b1.


SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.

SELECT-OPTIONS : s_dispo FOR marc-dispo,  "MRP Controller
                 s_dismm  FOR marc-dismm, "MRP Type
                 s_mmsta FOR marc-mmsta.  "Plant-Specific Material Status
SELECTION-SCREEN END OF BLOCK b2.

I have just designed selection screen as shown above.

Please help me out on how do I achieve this. Post ur ideas and suggestions. Thanks in advance..

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
882

Hi,

You will achieve by using the AT selection screen events. specially for At selection screen output.

Please check the demo programs DEMO_AT_SELECTION_SCREEN*

Thanks,

Kiran

4 REPLIES 4
Read only

Former Member
0 Likes
883

Hi,

You will achieve by using the AT selection screen events. specially for At selection screen output.

Please check the demo programs DEMO_AT_SELECTION_SCREEN*

Thanks,

Kiran

Read only

Former Member
0 Likes
882

hi Aravindh kumar,

if s_dispo is initial  and s_dismm is inital and  s_mmsta is inital.

**** the above stmt tells tht all the values in the 2nd selection block are empty.

***tht means user inputs data in only 1st block or in both the blocks.

     Make a Innerjoin between those 2 tables PLAF and MARC tables with a on condition Matnr =                                                                  Dispo.                         "for 1 and 2 options.

***In this case innerjoin increases the performance the prog when compared to for all entries...

else.

** enters data only in the 2nd block.

     select data from only from PLAF table.            "for option 3.

endif.

I think my answer is helpful. Feel  free to ask questions.

Thanks and regards,

Prasanth

Read only

Former Member
0 Likes
882

Hi

Could you please make the question more clear. Here do you the option to enter in the all the blocks.

For you current scenario you can use FOR ALL ENTRIES to fetch values from multiple tables.

Eg Select field name

       from table name

       into internal table

       FOR ALL ENTRIES in internaltable name

       where key.

If you want to validate any screen fields you can mention it in the AT SELECTION SCREEN event.

Warm regards

Suneesh

Read only

thangam_perumal
Contributor
0 Likes
882

Hi Arvindh Kumar,

                           Please use the select statements and move the values are target Internal table.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.

SELECT-OPTIONS : s_paart FOR plaf-paart,  "Order Type
                 s_plwrk FOR plaf-plwrk,  "Plant
                 s_matnr FOR plaf-matnr,  "Material
                 s_plnum FOR plaf-plnum.  "Planned Order Number
SELECTION-SCREEN END OF BLOCK b1.


SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.

SELECT-OPTIONS : s_dispo FOR marc-dispo,  "MRP Controller
                 s_dismm  FOR marc-dismm, "MRP Type
                 s_mmsta FOR marc-mmsta.  "Plant-Specific Material Status
SELECTION-SCREEN END OF BLOCK b2.

AT-SELECTION-SCREEN.

select ......      from ... into  internal table where ( Please Give your condition.).

if u press enter or someother user commands mean first AT-SELECTION-SCREEN block will be Execute.

Regards,

Thangam.P

Regards,

Thangam.P