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

selection-screen programming

Former Member
0 Likes
1,304

Hi experts,

I need to validate the selection-screen fields p_bukrs(comp. code) / p_abkrs(payroll area) / p_lifnr / p_bkref such that the fields p_abkrs / p_lifnr / p_bkref to be fetched from Table (z-table) based on company code ,p_bukrs given at selection-screen levelu2026

In z-table, payroll area (p_abkrs) is the only key field

Values in z-table

Payroll area ccode vendor bkref

AB 1000 123 1111

BC 2000 234 2222

CD 1000 345 3333

DE 3000 456 4444

At selection-screen level, 1) if user chose u20182000u2019 p_bukrs and press enter, itu2019s supposed to get all related values i.e u2018BCu2019 u2018234u2019 u20182222u2019 for p_abkrs p_lifnr p_bkref resp.

2) If user chose u20181000u2019, as it is having 2 payroll areas, we come across multiple selection, so again f4 help shud be provided and should accommodate the user to select the one from multiple to be displayed on selection-screen.

So for the first option, itu2019s just providing f4 help and fetching values

But for second one, pls provide the required logic as I met all failure attemptsu2026u2026..

That would be a great help, if provide any inputsu2026u2026u2026u2026..

With Regards

Andhari

10 REPLIES 10
Read only

Former Member
0 Likes
1,262

If I understand your requirement, you need to have a F4 help to return multiple values in an internal table? Try using F4IF_INT_TABLE_VALUE_REQUEST. You will find many threads for the same

Read only

Former Member
0 Likes
1,262

hi,

Use the below logic.

AT selection-screen.

if p_bukrs is not initial.

select single abkrs lifnr bkref from z-table

into p_abkrs p_lifnr p_bkref where bukrs = p_bukrs.

endif.

the above will useful only if u have one value. if u have multiple values then use select-options in place of parameters.

in that case use the below logic.

AT selection-screen.

if p_bukrs is not initial.

select abkrs lifnr bkref from z-table

into table itab where bukrs = p_bukrs.

loop at itab.

s_lifnr-sign = 'I'.

s_lifnr-option = 'eq'.

s_lifnr-low = itab-lifnr.

append s_lifnr.

similarly fill the remaining.

endloop.

endif.

Edited by: subas Bose on Apr 5, 2010 7:25 PM

Edited by: subas Bose on Apr 5, 2010 7:29 PM

Read only

Former Member
0 Likes
1,262

Hi Andhari,

In your #2, on P_BUKRS, assuming that this is a parameter, so when the user click a pick list, a new screen should come out to accommodate entries below?

AB 1000 123 1111

BC 2000 234 2222

CD 1000 345 3333

DE 3000 456 4444

If Yes, then you should indicate the F4/Picklist Help on the POV(Process On Value Event), please see the link: [Input Help|http://help.sap.com/saphelp_NW04/helpdata/en/9f/dbaac935c111d1829f0000e829fbfe/content.htm]

If no, and you just simply want to populate your ITAB.


SELECT bukrs abkrs lifnr bkref
  FROM z_table
    INTO CORRESPONDING FIELDS OF ITAB_ZTABLE
WHERE abkrs EQ p_abkrs.

This will give your ITAB_ZTABLE 2 rows.

Please let me know if I can provide mode details on POV.

Regards,

Jun

Read only

0 Likes
1,262

Hi Jun

Your analysis is absolutely right and i want to go for 'Yes' option as you said....

pls provide example code on using 'POV', it would be easy if i get an example on my requirement...

TIA

Regards

Andhari

Read only

0 Likes
1,262

Hi suri,

SELECTION-SCREEN BEGIN OF SCREEN 1001 AS SUBSCREEN.

SELECTION-SCREEN SKIP.

SELECT-OPTIONS: s_kschli FOR nast-kschl.

SELECTION-SCREEN END OF SCREEN 1001.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_kschli-low.

PERFORM get_value_kschl USING s_kschli.

FORM get_value_kschl USING p_p_kschli.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'KSCHL'

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = 'S_KSCHLI-LOW'

value_org = 'S'

TABLES

value_tab = t_kschl2.

ENDIF.

endform.

Regards,

Raj.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,262

Hello Andhari,

You can select multiple entries by passing MULTIPLE_CHOICE = 'X' to F4IF_INT_TABLE_VALUE_REQUEST.

Please refer to this post for details:

Read only

0 Likes
1,262

Hi Suhas,

In my requirement, no need to go for u2018multiple optionsu2019, wil explain u the scenario in briefu2026

At selection-screen level, after pressin f4 at ccode field, wil shows u list of ccodes, whose values fetch from ztable (refer to my thread for ztable values) here I did using select single & fm <f4if_int_table_value_request>

In values of ztable, for ccode u20181000u2019, itu2019s having 2 payroll areas i.e u2018ABu2019 and u2018CDu2019, so if user chose u20181000u2019 in list, another f4 shud display showin the related list to accomdate user to select related payroll area and make it displayed on sel-screen.

In my code, while chosing u20181000u2019, in the f4 list (having 2 entries), irrespective of my selection itu2019s displaying 2nd entry i.e. u2018CDu2019 u2018345u2019 u20183333u2019u2026u2026hope you understand

And here is my code reg. selecting '1000' where this multiple selection comes....

< IF p_bukrs EQ '1000'.

< SELECT abkrs

< lifnr

< bkref

< FROM ztable

< INTO TABLE gt_split u201Csplit holds payroll,lifnr,bkref

< WHERE bukrs = p_ccode.

< CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

< EXPORTING

< retfield = 'ABRKS'

< DYNPPROG = sy-repid

< DYNPNR = sy-dynnr

< DYNPROFIELD = 'P_BUKRS'

< VALUE_ORG = 'S'

<* MULTIPLE_CHOICE = ' '

<* DISPLAY = ' '

<* CALLBACK_PROGRAM = ' '

<* CALLBACK_FORM = ' '

<* MARK_TAB =

<* IMPORTING

<* USER_RESET =

< tables

< value_tab = gt_split

<* FIELD_TAB =

< RETURN_TAB = gt_return

<* DYNPFLD_MAPPING = fmap

<* 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.

< LOOP AT gt_split INTO gs_split.

< p_payrol = gs_split-abkrs.

< p_lifnr = gs_split-lifnr.

< p_bkref = gs_split-bkref.

< ENDLOOP.

< ENDIF.

< ENDIF.

TIA

Regards

Andhari

Read only

0 Likes
1,262

Hi Andhari,

Try this one:


PROCESS BEFORE OUTPUT.
....

PROCESS AFTER INPUT.
....

PROCESS ON VALUE-REQUEST.
  FIELD P_ABKRS MODULE GET_LINE_ABKRS INPUT.

  MODULE GET_LINE_ABKRS INPUT.
    CALL FUNCTION u2018F4IF_FIELD_VALUE_REQUESTu2019
      EXPORTING
        tabname  = u2018ZTABLEu2019
        fieldname = u2018ABKRS'u2019
*       SEARCHHELP = u2018 u2018
*       SHLPPARAM = u2018 u2018
        dynpprog    = sy-repid
        dynpnr        = sy-dynnr
        dynprofield  = u2018P_ABPKRSu2019
*       STEPL = 0
*       value =    "<--you use this to limit your filter
*       MULTIPLE_CHOICE = u2018 u2018
*       DISPLAY = u2018 u2018
*      SUPPRESS_RECORDLIST = u2018 u2018
*      CALLBACK_PROGRAM = u2018 u2018
*      CALLBACK_FORM = u2018 u2018
*    TABLES
*      RETURN_TAB =
*    EXCEPTIONS
*      FIELD_NOT_FOUND = 1
*      NO_HELP_FOR_FIELD = 2
*      INCONSISTENT_HELP = 3
*      NO_VALUES_FOUND = 4
*     OTHERS = 5
.
IF sy-subrc 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

ENDMODULE.

This should pop-out a new window for your selection..

Regards,

Jun

Read only

0 Likes
1,262

Hi

Problem is solved...and thanks to all

In my code given above,

in fm <f4if_int_table_value_request>, no need to pass value to the parameter DYNPROFIELD.

And in the Loop provided for gt_split (in last loop), i written the code like...

LOOP AT gt_split INTO gs_split.

CLEAR gs_return.

READ TABLE gt_return INTO gs_return WITH KEY FIELDVAL = gs_split-abkrs.

IF sy-subrc IS INITIAL.

p_abkrs = gs_split-abkrs.

p_lifnr = gs_split-lifnr.

p_bkref = gs_split-bkref.

ENDIF.

ENDLOOP.

Regards

Andhari

Read only

0 Likes
1,262

good! adding this code also for your thread / reference.


REPORT  zpov.

TABLES: ztable_pov, dfies.
DATA: itab_ztable TYPE STANDARD TABLE OF ztable_pov,
      itab_fields TYPE TABLE OF dfies,
      wa_field    TYPE dfies.

INITIALIZATION.

*move: 'AB'    to ztable_pov-abkrs,
*      '1000'  to ztable_pov-bukrs,
*      '123'   to ztable_pov-bkref,
*      '1111'  to ztable_pov-lifnr.
*INSERT ztable_pov from ztable_pov.
*"DELETE from ztable_pov.
*commit WORK AND WAIT.

  PARAMETERS: p_abkrs LIKE ztable_pov-abkrs,
              p_bkref LIKE ztable_pov-bkref,
              p_bukrs LIKE ztable_pov-bukrs,
              lifnr   LIKE ztable_pov-lifnr.

  SELECT *
    FROM ztable_pov
    INTO TABLE itab_ztable.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_bukrs.
  PERFORM f4_get_bukrs.

START-OF-SELECTION.

END-OF-SELECTION.

see the final output screenshot

[screenshot|http://img697.imageshack.us/img697/8955/f4picklistfromztable.jpg]

Moderator message - Please respect the 2,500 character maximum when posting. Post only the relevant portions of code. Your two posts could easily have formatted correctly if you had removed the lines that were commented out,

Edited by: Rob Burbank on Apr 6, 2010 1:28 PM