‎2006 Aug 21 10:19 PM
Hello SAPients.
I have a selection screen with these two fields:
parameters:
pa_vkorg like tvko-vkorg. " Sales Organization
select-options:
so_werks for t001w-werks. " Plant
My question is: How can I code an automatic validation to ensure that in the Plant field the user only see plants that are related to the Sales Organization previously selected?
I have an idea of using Memory ID but I'm not sure that's the best way of doing it.
Thank you in advance.
Message was edited by: Ricardo Fernández Vázquez
‎2006 Aug 21 10:39 PM
Hi,
Check this out..
s_werks FOR t001l-werks MODIF ID bbb,(Plant)
s_lgort FOR t001l-lgort MODIF ID bbb,(Storage Locations)
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-group1 = 'BBB'.
screen-active = '1'.
screen-input = '1'.
screen-output = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
Regards
Vara
‎2006 Aug 22 12:01 AM
‎2006 Aug 22 12:12 AM
Hi Abdul,
Thanks for your help, that's exactly what I found and that's what I'm using.
The problem that I have now is that my search help doesn't receive the value of the Sales Organization unless a hit enter after populating the value of the SalOrg field.
That's because I'm receiving it in the parameter id VKO.
My new question is: Do you know other way to send this value to the search help? I also tried with set parameter id 'VKO'... in the "at selection-screen on value-request for so_werks-low" event. But I receive the error message 'The addition "ON VALUE-REQUEST FOR" is not allowed with PARAMETERS or SELECT- OPTIONS if MATCHCODE OBJECT is present'
By the way I'm working with SAP 4.6C.
Thank you.
‎2006 Aug 22 12:17 AM
hi ricardo,
i think using search help is the best way and you need to do give the sales.org value for determining the plant details.this is how the standard SAP system function also been implemented.
if you wanna diplay the plant as soon as the user enters the sales org then you need to achieve the same in the PAI event AT SELECTION-SCREEN by using SELECT clause to fetch the valid plants and you can display the valid plants to the user.Keep in mind that you are triggering PAI here also. The best approach is using Search Help..
Cheers,
Abdul Hakim