2014 Oct 17 9:23 AM
Hi all,
how can I achieve this ?
Selection screen:
Validate selection screen:
Mandatory fields, user has to enter either 1 OR 2 OR both .
selection-screen begin of block b1 WITH FRAME.
select-OPTIONS: so_vbeln for vbak-vbeln ,
so_erdat for vbak-erdat.
SELECTION-SCREEN end of BLOCK b1.
At selection screen.
IF so_vbeln = 0 .
IF so_erdat = 0.
MESSAGE 'CANNOT EMPTY' TYPE 'E'.
ENDIF.
ENDIF.
I am not able to validate my selection screen.
please help.
Thanks.
2014 Oct 17 9:28 AM
hi,
on selection screen output
check if so_erdat is initial
and so_vbeln is initial
regards
Stefan Seeburger
Hi all,
how can I achieve this ?
Selection screen:
Validate selection screen:
Mandatory fields, user has to enter either 1 OR 2 OR both .
selection-screen begin of block b1 WITH FRAME.
select-OPTIONS: so_vbeln for vbak-vbeln ,
so_erdat for vbak-erdat.
SELECTION-SCREEN end of BLOCK b1.
At selection screen.
IF so_vbeln = 0 .
IF so_erdat = 0.
MESSAGE 'CANNOT EMPTY' TYPE 'E'.
ENDIF.
ENDIF.
I am not able to validate my selection screen.
please help.
Thanks.
2014 Oct 17 9:28 AM
hi,
on selection screen output
check if so_erdat is initial
and so_vbeln is initial
regards
Stefan Seeburger
2014 Oct 17 9:37 AM
Stefan Seeburger wrote:
hi,
on selection screen output
check if so_erdat is initial
and so_vbeln is initial
regards
Stefan Seeburger
A better way to check is
if so_erdat[] is initial
and so_vbeln[] is initial
->Error
This because select-options are internal tables
2014 Oct 17 9:45 AM
But my requirement is :
user has to enter either 1 OR 2 OR both.
can I achieve this using above code?
2014 Oct 17 9:51 AM
But i wrote it!
AT SELECTION-SCREEN.
IF so_vbeln[] IS INITIAL AND so_erdat[] IS INITIAL.
MESSAGE 'CANNOT EMPTY' TYPE 'E'.
ENDIF.So the user is forced to fill so_vbeln OR so_erdat OR both, otherwise get the error..
2014 Oct 17 10:06 AM
It works.
Thank you so much .
1 more Question:
Get the Sales Order relevant records from VBAK table using selection screen details
and Get relevant line item records from VBAP.
for this i tried it in below way:
select vbeln
posnr
matnr
lfrel
ablfz
kwmeng
erdat
FROM vbap
INTO TABLE it_vbap
WHERE vbeln = so_vbeln.
SELECT vbelv
fplnr
fpltr
FROM vbfa
INTO TABLE it_vbfa.
but i am not getting any data in my internal table.
2014 Oct 17 10:13 AM
2014 Oct 17 10:52 AM
i have to Get the Sales Order relevant records(fplnr,fpltr) from VBAK table using selection screen details(so_vbeln and so_erdat)
and Get relevant line item records from VBAP(vbeln,posnr,matnr,lfrel,ablfz,kwmeng,erdat).
for that I tried above code but its not working.
2014 Oct 17 10:56 AM
Select <fields you need> into table <internal table with vbeln + posnr +fields you need> from vbak
inner join vbap on vbap~vbeln = vbak~vbeln
Where vbak~vbeln in so_vbeln
and vbap~erdat in so_Erdat.
But this is basic question about SQL, even before abap....