on 08-16-2005 9:16 PM
Here is one scenario.
this is related to Stock transport order between two plants.
In selection screen, vbrk-kunag and vbrp-werks(supplying plant) fields are there.
If vbrk-kunag field start with 'P'.I will get the second plant field By removing the initial 'P' in
field vbrk-kunag.
now i have to read zplants table with vbrp-werks and vbrk-kunag(Without Initial 'P') field .If it matches i have to substitute vbrp-werks field with zplants-plnt.
Zplants table has fields like werks & reswk(supplying plant),plnt.
In the selection screen, If multiple values are entered in vbrk-kunag field, I have to check the above condition (match) again, If it is not matches just i have to add "P123" value and don't remove the original supplying plant(vbrp-werks) from the selection.
how can i write the above statements...
Thanks in advance.
Fractal
U can do this in the Validation part.
AT SELECTION-SCREEN OUTPUT on s_kunag.
perform....
In that perform if u have multiple select option then while validating use
SELECT ... ENDSELECT
.
In that u can try to change as per ur requirement.
Hope this hleps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is clear explanation.
Somebody developed a report, now i am doing some modifications.we have one form like "process data",In this i am adding my code.I want to validate that scenario before or after the following select statements.
1.some of skunag field values starts with 'P'.If skunag field start with 'P',By removing the initial 'P' in field skunag. I will get the second plant field.
Zplants table has fields like werks & reswk(supplying plant),plnt.now i have to read zplants table and have to match with swerks and skunag(Without Initial 'P') field .If it matches i have to substitute swerks field with zplants-plnt field.
2.In the selection screen, If multiple values are entered in skunag field,I have to check the above condition (match) again, If it is not matches just i have to
add "P123" value and don't remove the original supplying plant swerks from the selection.
SELECT vbeln kunag zuonr vkorg waerk fkart
FROM vbrk INTO
CORRESPONDING FIELDS OF TABLE itab
WHERE vbeln IN svbeln
AND kunag IN skunag.
LOOP AT itab.
SELECT vbeln posnr vgbel aubel aupos
matnr werks erdat arktx charg
fkimg vrkme prsdt netwr kzwi6
FROM vbrp INTO
CORRESPONDING FIELDS OF it
WHERE vbeln = itab-vbeln
AND vgbel IN svgbel
AND werks IN swerks
AND erdat IN serdat.
CHECK sy-subrc EQ 0.
thats it....
how can i write the select statements now...
Thanks in advance,
Fractal.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
let me try , but not sure this is correct ans, i am little unable to understand you requirement.
variable1 = vbrk-kunag+0(1).
if variable1 is initial
...
endif
if not variable1 is initial
...
endif.
variable2 = vbrk-kunag+2(strlen - 1)
or select * from zplant into itab where
vbrp-werks = variable2.
regards.
just a try,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.