2009 Nov 05 8:57 AM
PARAMETERS : PLANT
SELECT-OPTIONS : MATERIAL
My Selection Screen contents of should change as the PLANT changes ..
and i want to populate the contents of SELECT-OPTIONS from an ITAB how can i do that .
wen plant changes its corresponding materials should reflect inthe Select -options. this is my need .
please solve..
thanks, .
Aslam.
\
PARAMETERS : PLANT
SELECT-OPTIONS : MATERIAL
My Selection Screen contents of should change as the PLANT changes ..
and i want to populate the contents of SELECT-OPTIONS from an ITAB how can i do that .
wen plant changes its corresponding materials should reflect inthe Select -options. this is my need .
please solve..
thanks, .
Aslam.
\
2009 Nov 05 9:09 AM
Hi
U need to select the material from MARC in the event AT SELECTION-SCREEN and fill the select-option MATNR: it's an internal table with following fields: SIGN, OPTION, LOW, HIGH.
Every records has to be filled having:
SIGN = 'I'.
OPTION = 'EQ'.
LOW = MARC-MATNR.
Now u should consider there's a limit of the records number can be insert in the range/select-options, if it exceeds the limit a sql dump occurs while selecting
Max
2009 Nov 05 9:11 AM
i want my material (select -option ) to get populated from an ITAB as the plant ( parameter ) changes ..
i dont want material frm MARC and i wnt toget from ITAB or any ztable .
hw can i do that .. ?
2009 Nov 05 9:17 AM
Hi Aslam,
For your query what you have to do is, Under AT SELECTION-SCREEN OUTPUT you have to write the code lines
1. You have to find all the relevent material number is an internal table.
2. Then use LOOP AT SCREEN. statement and find the screen name as MATERIAL (Given name for the select option)
3. when foud during the loop, put a loop on the intenal table and assing values one by one in screen element MATERIAL-LOW .
4. your work is done.
If you want a sample code, Please let me know.
Regards,
Raj Gupta
Edited by: RajGupta on Nov 5, 2009 11:52 AM
2009 Nov 05 10:09 AM
Hi
Then in the event AT SELCTION-SCREEN loops your table ITAB in according the plant and move the material code to the select-options just as I've described before.
The logic is the same just only u need to use LOOP AT ITAB, instead of SELECT * FROM MARC.
Now the problem it's the event AT SELCTION-SCREEN will be triggered as soon as the user press a button, it's not possible to use the option USER-COMMAND in order to trigger the event as soon as the user change the plant, because this option works with radiobutton and checkbox only.
Max
2009 Nov 05 10:22 AM
Hi Raj,
No offence meant to anyone . When I read the question , the first solution came to my mind was the once suggested by Max.
Honestly speaking If I would have been implementing this I would have tried Max's solution and if it would not have worked then the one suggested by you. Since while implementing I always have the option to debug and find out if its working fine in every case.
I am just curious to know if I would have appeared for the interview and you ask me only this question and i would have answered the max's solution , would u have selected me [:d]?
I am not saying which solution is better bcoz I have not checked,
2009 Nov 05 10:35 AM
Hi Rajesh,
I am happy that you pointed me this.
But my question was not to only populate the select-option for further use in rest of the program.
I have mentioned AT SELECTION-SCREEN OUTPUT, because i wanted to be on the same screen after hitting enter or any button, but with the data populated in the select option.
I know that if i want to pupulate the select option for further use in the program code only, then i don't have to use the code logic mentioned by me, and in that case Max solution is best.
But i want to modify the SCREEN.
Hope you understood now.
Regards,
Raj Gupta
Edited by: RajGupta on Nov 5, 2009 11:36 AM
2009 Nov 05 10:50 AM
Srry Raj u misundersttod me ...
I was not saying ur solution is not gud ...my question was different .....may be this is not the right forum to ask what i want to know ....
just bear with me moderators plz ...
i just wanted to understand the interview process...since I have not appreared for any interview ( I started my carreer with a company and I am still with it ..wuld luv to continue [:d])
I believe , if you would have asked me the same question probably i would not have given u the best possible solution...as u r also admitting for ur particular scenario ur solution is better than max's .....
as an inteviewer will u expect the best solution from me .....( which might not come to my mind ( nd I am sure will not ..I luv abap debugger ) or u just wanna check if I know how to use difference selection screen events .
If u wanted to hear only the better solution ...( I am rejected ............now I will have to continue sticking to my current job [:d], not bcoz i prefer but bcoz I cant switch )
if u want to test if i know how to use selection screen events then ( I am selected ...but now I would like to stick to my current job ...bcoz I want to )
Now I realize I cannot do ABAP without Debugger.
2009 Nov 05 11:02 AM
hummm
It's a good style... i appreciate it yeah one more thing 'moderators please excuse me'
So Rajesh, what i understood with your commets is that, i asked sily questions. yeah that could be. but i think basic things are quite important for any language or technology.
still i must say you that this question has been asked in many reputed comps. like IBM.
so you can't underestimate this.
any ways it's a good habit to use debugger, even i do the same.
and one more thing i think you reacted in such fashion cos i wrote "who took your interview"
If this is the case. so let me tell you that i wrote this cos i wanted Aslam to just recall me nothing else.
At last, sorry to all the forum contributors regarding this silly discussion.
Raj Gupta
2009 Nov 05 11:13 AM
Sorry to everyone who might treat this discussion useless ...Raj ..honestly speaking in no way I was trying to prove that question silly or point fingers at you in any sense .....
I am sorry but i feel I am unable to express what I what to know ...lets forget this discussion .......In no way I was trying to prove u wrong ...
lets close this discussion [:d]
2009 Nov 09 12:46 PM
Yes please let me have the sample code ..for the requirement ..
thanks . .
aSlam .
2009 Nov 05 10:52 AM
Check this example
This code will hep you but the select options gets filled after entering the value and hitting enter.
if you need the other way create search help and make use of F4IF_INT_TABLE_VALUE_REQUEST
TABLES:marc.
PARAMETER:pa_matnr TYPE matnr.
SELECT-OPTIONS:so_werks FOR marc-werks NO-EXTENSION.
AT SELECTION-SCREEN OUTPUT.
if pa_matnr is not initial.
DATA:itab TYPE TABLE OF marc.
DATA:wa TYPE marc.
SELECT * FROM marc INTO TABLE itab WHERE matnr = pa_matnr.
IF sy-subrc = 0.
LOOP AT itab INTO wa.
so_werks-low = wa-werks.
APPEND so_werks.
ENDLOOP.
ENDIF.
endif.
2009 Nov 05 11:08 AM
Thanks Kesu,
Your answer is best one. even i corrected my answer too with the help of yours.
(i found that there is no need of using LOOP AT SCREEN).
Regards,
Raj Gupta
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |