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

AT SELECTION SCREEN ON VALUE REQUEST

former_member422932
Participant
0 Likes
961

I have a "at selection screen" defined as:

AT SELECTION-SCREEN ON VALUE-REQUEST FOR KSCYC-LOW.

When the user hits F4 I need the user to see the following database fields T811C-CYCLE and T811L-TXT, but when the user selects a line it should only return the T811C-CYCLE. I am currently using the Function Module F4IF_INT_TABLE_VALUE_REQUEST, but this doesn't return the data I need. Can someone tell me if there is a different function module I need to use to get the results I need?

8 REPLIES 8
Read only

Former Member
0 Likes
918

That is the correct FM. You must be using it incorrectly.

Post your code.

Read only

marcelo_ramos1
SAP Mentor
SAP Mentor
0 Likes
918

Hi,

Try this way,

TYPES: BEGIN OF TY_MOTIVO,

DESC_MOTIVO TYPE ZDESCR_MOTIVO,

MOTIVO TYPE ZMOTIVO_CANC,

END OF TY_MOTIVO.

DATA: TL_MOTIVO TYPE STANDARD TABLE OF TY_MOTIVO,

E_MOTIVO TYPE TY_MOTIVO.

SELECT *

FROM ZBFI_MOTIVO

INTO CORRESPONDING FIELDS OF TABLE TL_MOTIVO.

  • Sort the list by the text.

SORT TL_MOTIVO BY MOTIVO AS TEXT.

LOOP AT TL_MOTIVO INTO E_MOTIVO.

CONCATENATE E_MOTIVO-MOTIVO ' - ' E_MOTIVO-DESC_MOTIVO INTO

E_MOTIVO-DESC_MOTIVO.

MODIFY TL_MOTIVO FROM E_MOTIVO.

ENDLOOP.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = <DYNPRO FIELD> <b>"You must put here your Dynpro field name</b>

VALUE_ORG = 'S'

TABLES

VALUE_TAB = TL_MOTIVO

EXCEPTIONS

OTHERS = 0.

Regards.

Marcelo Ramos

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
918

Hi,

The FM you are using is the right one, make sure you are passing the paramters and the dynpro field names etc correctly. ALso make sure the screen field names are mentioned in Capital letters.

Regards,

Sesh

Read only

Former Member
0 Likes
918

Hi Mazurek

The function module you are using is correct but.

You have to change a bit the way you call the function.

provide the internal table which contains the fields you want to display

like

data: begin of ITAB_F4HLP occurs 0,

cycle like T811C-CYCLE ,

TXT like T811L-TXT,

endof itab_f4help.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'CYCLE'

DYNPPROG = SY-REPID

DYNPNR = '1000'

DYNPROFIELD = kscyc-low

VALUE_ORG = 'S'

TABLES

VALUE_TAB = ITAB_F4HLP.

Award points If help full

Read only

Former Member
0 Likes
918

Hi,

That Function module is enough for your requirement.

Use the internal table what are the fields requred for your selection and pass it to the selection screen and return value 'FIELD NAME" which u want to return...

at last return the value that you have selected by means of the return structure.

DATA : return_struc LIKE ddshretval OCCURS 0 WITH HEADER LINE.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'field name'

value_org = 'S'

TABLES

value_tab = internal table name

return_tab = return_struc

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

zzlocod = return_struc-fieldval. returning field...

Thanks,

Yogesh

Read only

former_member422932
Participant
0 Likes
918

Here is my code:

DATA: BEGIN OF ISELOPT1 OCCURS 0,

CYCLE LIKE T811C-CYCLE,

TEXT LIKE T811L-TXT,

END OF ISELOPT1.

CLEAR IDFIES[].

CLEAR IDDSHRETVAL[].

IDFIES-TABNAME = 'T811C'.

IDFIES-FIELDNAME = 'CYCLE'.

APPEND IDFIES.

SELECT DISTINCT CYCLE TXT FROM T811C INTO TABLE ISELOPT1

WHERE LANGU = SY-LANGU AND SEQNR = ''.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = IDFIES-FIELDNAME

TABLES

VALUE_TAB = ISELOPT1

FIELD_TAB = IDFIES

RETURN_TAB = IDDSHRETVAL

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2

OTHERS = 3.

Read only

0 Likes
918

Hi,

check the code


DATA: fld_name type FIELDNAME. "Check the new variable
DATA: BEGIN OF ISELOPT1 OCCURS 0,
CYCLE LIKE T811C-CYCLE,
TEXT LIKE T811L-TXT,
END OF ISELOPT1.

CLEAR IDFIES[].
CLEAR IDDSHRETVAL[].
IDFIES-TABNAME = 'T811C'.
IDFIES-FIELDNAME = 'CYCLE'.
APPEND IDFIES.

SELECT DISTINCT CYCLE TXT FROM T811C INTO TABLE ISELOPT1
WHERE LANGU = SY-LANGU AND SEQNR = ''.

CONCATENATE IDFIES-TABNAME '-' IDFIES-FIELDNAME 'LOW'  INTO fld_name 
*concatenate table name, field name and LOW if you need else remove LOW from this statement
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = fld_name "pass new variable
TABLES
VALUE_TAB = ISELOPT1
FIELD_TAB = IDFIES
RETURN_TAB = IDDSHRETVAL
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3. 

Regards,

Sesh

Read only

Former Member
0 Likes
918

this funcation module is correct no problem

F4IF_INT_TABLE_VALUE_REQUEST