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

validation for selection screen

Former Member
0 Likes
526

hi all,

can anyone help me on the particular issue for adding f4 functionality based on selection criteris.i am using the code below but i am not able to get the selection.

SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

PARAMETERS: P_MBLNR LIKE MKPF-MBLNR OBLIGATORY, "Customer Number

P_WERKS LIKE MSEG-WERKS OBLIGATORY.

SELECTION-SCREEN:SKIP 2.

SELECTION-SCREEN: BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-001.

PARAMETERS: RAD1 RADIOBUTTON GROUP RAD DEFAULT 'X',

RAD2 RADIOBUTTON GROUP RAD.

SELECTION-SCREEN END OF BLOCK B2.

SELECTION-SCREEN END OF BLOCK B1.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_MBLNR.

DATA: BEGIN OF I_MBLNR OCCURS 0,

V_MBLNR LIKE MSEG-MBLNR,

V_BWART LIKE MSEG-BWART,

END OF I_MBLNR.

IF NOT P_MBLNR IS INITIAL.

IF RAD1 = 'X'.

SELECT SINGLE MBLNR INTO I_MBLNR-V_MBLNR FROM MSEG

WHERE BWART = '541'.

ELSEIF RAD2 = 'X'.

SELECT SINGLE MBLNR INTO I_MBLNR-V_MBLNR FROM MSEG

WHERE BWART = '551'.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

DDIC_STRUCTURE = MSEG-MBLNR

RETFIELD = IT_HEADER-MBLNR

  • PVALKEY = ' '

  • DYNPPROG = ' '

  • DYNPNR = ' '

  • DYNPROFIELD = ' '

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

  • VALUE_ORG = 'C'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

TABLES

VALUE_TAB = IT_HEADER.

  • FIELD_TAB =

  • RETURN_TAB =

  • DYNPFLD_MAPPING =

  • EXCEPTIONS

  • PARAMETER_ERROR = 1

  • NO_VALUES_FOUND = 2

  • OTHERS = 3

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDIF.

ENDIF.

5 REPLIES 5
Read only

Former Member
0 Likes
502

hi,

where are you populating the internal table it_header.

regards,

Navneeth K.

Read only

0 Likes
502

HI NAVNEET ,

thanks for replying actuallty i have n internal table it_header which i have used it for my program but this interna table i have used only for selection criteria. can you plz see the portion of my code which i have used for selection criteria.please find below

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_MBLNR.

DATA: BEGIN OF I_MBLNR OCCURS 0,

MBLNR LIKE MSEG-MBLNR,

END OF I_MBLNR.

IF NOT ( P_MBLNR IS INITIAL ).

refresh i_mblnr.

clear i_mblnr.

IF ( RAD1 = 'X' ).

SELECT MBLNR INTO I_MBLNR FROM MSEG

WHERE BWART = '541'.

ENDSELECT.

ELSEIF ( RAD2 = 'X' ).

SELECT MBLNR INTO I_MBLNR FROM MSEG

WHERE BWART = '551'.

ENDSELECT.

ENDIF.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = 'MSEG'

RETFIELD = 'MBLNR'

  • PVALKEY = ' '

DYNPPROG = SY-REPID

DYNPNR = SY-DYNNR

DYNPROFIELD = 'P_MBLNR'

VALUE_ORG = 'S'

CALLBACK_FORM = SY-REPID

TABLES

VALUE_TAB = I_MBLNR

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDIF.

Read only

0 Likes
502

Hi Abinash,

Just remove the below code and it should work.

<b>IF NOT ( P_MBLNR IS INITIAL ).</b>

and corresponding ENDIF.

Reward points if useful.

Regards,

Atish

Read only

0 Likes
502

hi Abinash,

the code looks fine , u have written code such a way that if mblnr value is given in the select-option then need not have f4 option.

just remove the

IF NOT ( P_MBLNR IS INITIAL ).

condition this will have F4 enabled every time, irrespectibe of any value enterd for mblnr by user.

regards,

Navneeth K.

Read only

0 Likes
502

HI,

i have removed that but when i press f4 its giving runtime error.