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

RUNTIME ERROR IN FM

Former Member
0 Likes
1,379

Hi All!

This is w.r.t. FM F4IF_INT_TABLE_VALUE_REQUEST.

For the variable return_tab I had declared an internal table with headerline and assigned it to return_tab.

This was for retrieving the selected value by user in the list box.

Now i am not getting any compilation error but during runtime i am getting an error saying "In the FM you can specify fields of a specific type and length under "return-tab".Although the current specified field "return-tab" is the correct type,its length is incorrect."

Can anybody throw light on this.

regards

Praneeth

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,326

could u plz send the code..so that we can check where ur going wrong.

16 REPLIES 16
Read only

Former Member
0 Likes
1,327

could u plz send the code..so that we can check where ur going wrong.

Read only

Former Member
0 Likes
1,326

i think u hav given an internal table with header line ,

check .

1.is this the same internal table u r populating for the f4 to be retrieved on a field.

2.perhaps on the f4 field check the declaration in ur program .

can u giv the code of the data declaration, f4_int_table value etc so that we can check the same ..

vijay

Read only

Former Member
0 Likes
1,326

Hi Praneeth,

This Function Module is for F4 help that returns the values selected in an internal table. Very handy when programming your very own F4 help for a field.

Please check out this example you may get an idea......

data:

begin of t_values occurs 2,

value like kna1-begru,

end of t_values,

t_return like ddshretval occurs 0 with header line.

t_values = 'PAR*'.

append t_values.

t_values = 'UGG'.

append t_values.

call function 'F4IF_INT_TABLE_VALUE_REQUEST'

exporting

retfield = 'BEGRU'

value_org = 'S'

tables

value_tab = t_values

return_tab = t_return

exceptions

parameter_error = 1

no_values_found = 2

others = 3.

if sy-subrc = 0.

read table t_return index 1.

o_begru-low = t_return-fieldval.

if o_begru-low = 'PAR*'.

o_begru-option = 'CP'.

else.

o_begru-option = 'EQ'.

endif.

o_begru-sign = 'I'.

append o_begru to s_begru.

else.

o_begru = i_begru.

endif.

Regards,

Azaz Ali Shaik.

Read only

Former Member
0 Likes
1,326

Hi Praneeth,

<b>DATA: RET_TAB LIKE DDSHRETVAL OCCURS 0 WITH HEADER LINE.</b>

    IF RET_TAB[] IS NOT INITIAL.
      READ TABLE RET_TAB INDEX 1.
      IF SY-SUBRC = 0.
        P_PLAN = RET_TAB-FIELDVAL.
      ENDIF.
    ENDIF.

Check how you declared the RET_TAB.

Regards

vijay

Read only

0 Likes
1,326

Hi,

in that case you can declare it as

<b>data: ret_tab type table of DDSHRETVAL .</b>

Regards

vijay

Read only

Former Member
0 Likes
1,326

Hi,

1. Declaration is not correct.

2. Decare it like this

Then u won't get any error.

data : RETURN_TAB LIKE DDSHRETVAL occurs 0 with header line.

regards,

amit m.

Read only

0 Likes
1,326

Hi All!

Thanks very much.I was indeed declaring it wrongly.your suggestion was to declare it as :

data : RETURN_TAB LIKE DDSHRETVAL occurs 0 with header line.

I have a small prob here I am not supposed to declare IT with headerline as per our coding standards.

Can u please suggest me any other way.

regards

Praneeth

Points rewarded

Read only

0 Likes
1,326

data: return_tab type standard table of ddshretval.

and work area separately

Read only

0 Likes
1,326

chang it to

data : RETURN_TAB type standard table of DDSHRETVAL .

Regards

Raja

Read only

0 Likes
1,326

hI aLL!

I am not getting any values into the RETURN_TAB.I had checked it with debugger.No values are returned when i am making selections in the list box of a input field on screen.Please advise

I am attaching the code :

REPORT zsdchk_tbl_mnt.

TABLES : zsdbd_chk_tabls.

DATA : ok_code TYPE sy-ucomm,

input1(8) TYPE c.

DATA : BEGIN OF i_tabname OCCURS 0,

tabname LIKE zsdbd_chk_tabls-tabname,

END OF i_tabname.

DATA : viewname LIKE zsdbd_chk_tabls-tabname.

DATA I_RETURN LIKE DDSHRETVAL OCCURS 0 WITH HEADER LINE.

CALL SCREEN 100.

MODULE init_screen_100 OUTPUT.

CLEAR: input1.

ENDMODULE. "init_screen_100 OUTPUT

  • Creating drop down list for input field

MODULE create_dropdown_box INPUT.

SELECT tabname FROM zsdbd_chk_tabls INTO CORRESPONDING FIELDS OF TABLE i_tabname.

  • Providing f4 help through drop down list to the user

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

retfield = 'tabname'

  • PVALKEY = ' '

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = 'A'

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

value_org = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

TABLES

value_tab = i_tabname

  • FIELD_TAB =

RETURN_TAB = i_return

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

ENDMODULE. "create_dropdown_box INPUT

MODULE user_command_0100 INPUT.

CASE ok_code.

WHEN 'MAINTAIN'. "when user presses maintain button

IF I_RETURN[] IS NOT INITIAL.

READ TABLE I_RETURN INDEX 1.

IF SY-SUBRC = 0.

VIEWNAME = I_RETURN-FIELDVAL.

ENDIF.

ENDIF.

  • Providing the view maintenance screen for check tables to the user.

CALL FUNCTION 'VIEW_MAINTENANCE_CALL'

EXPORTING

action = 'U'

  • CORR_NUMBER = ' '

  • GENERATE_MAINT_TOOL_IF_MISSING = ' '

  • SHOW_SELECTION_POPUP = ' '

view_name = viewname

  • NO_WARNING_FOR_CLIENTINDEP = ' '

  • RFC_DESTINATION_FOR_UPGRADE = ' '

  • CLIENT_FOR_UPGRADE = ' '

  • VARIANT_FOR_SELECTION = ' '

  • COMPLEX_SELCONDS_USED = ' '

  • CHECK_DDIC_MAINFLAG = ' '

  • SUPPRESS_WA_POPUP = ' '

  • TABLES

  • DBA_SELLIST =

  • EXCL_CUA_FUNCT =

  • EXCEPTIONS

  • CLIENT_REFERENCE = 1

  • FOREIGN_LOCK = 2

  • INVALID_ACTION = 3

  • NO_CLIENTINDEPENDENT_AUTH = 4

  • NO_DATABASE_FUNCTION = 5

  • NO_EDITOR_FUNCTION = 6

  • NO_SHOW_AUTH = 7

  • NO_TVDIR_ENTRY = 8

  • NO_UPD_AUTH = 9

  • ONLY_SHOW_ALLOWED = 10

  • SYSTEM_FAILURE = 11

  • UNKNOWN_FIELD_IN_DBA_SELLIST = 12

  • VIEW_NOT_FOUND = 13

  • MAINTENANCE_PROHIBITED = 14

  • OTHERS = 15

.

IF sy-subrc <> 0.

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

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

ENDIF.

ENDCASE.

ENDMODULE. "user_command_0100 INPUT

regards

Praneeth

Read only

0 Likes
1,326

Hi Praneeth,

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
* DDIC_STRUCTURE = ' '
retfield = <b>'TABNAME'</b>
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'A'
value_org = 'S'
TABLES
value_tab = i_tabname
RETURN_TAB = i_return
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.

Regards

vijay

Read only

Former Member
0 Likes
1,326

Since DDSHRETVAL is a structure

so u can say

DATA: BEGIN OF intern OCCURS 0.

INCLUDE STRUCTURE DDshrretval.

DATA: END OF intern.

vijay.

Read only

Former Member
0 Likes
1,326

Hi praneeth,

1. Why are u using return_tab ?

2. Is this your requierment ?

a) the user selects something from the list.

b) u want to get the selected value

c) plus, other fields (of the selected row)

3. Then u can do like this

4. This program will display company information,

and on selection,

it will populate the other fields

(from the selected value)

5. Select BUKRS,

it will fill,

company name,

location

country

6. just copy paste in new program

REPORT abc.

*----


DATA : dd LIKE TABLE OF dselc WITH HEADER LINE. "*--- IMPORTANT

DATA : ft LIKE TABLE OF dfies WITH HEADER LINE.

DATA : t001 LIKE TABLE OF t001 WITH HEADER LINE.

*----


PARAMETERS : bukrs LIKE t001-bukrs .

PARAMETERS : butxt LIKE t001-butxt.

PARAMETERS : ort01 LIKE t001-ort01.

PARAMETERS : waers LIKE t001-waers.

*----


AT SELECTION-SCREEN ON VALUE-REQUEST FOR bukrs.

SELECT * FROM t001 INTO TABLE t001.

*----


IMPORTANT

REFRESH dd.

dd-fldname = 'BUTXT'.

dd-dyfldname = 'BUTXT'.

APPEND dd.

dd-fldname = 'ORT01'.

dd-dyfldname = 'ORT01'.

APPEND dd.

dd-fldname = 'WAERS'.

dd-dyfldname = 'WAERS'.

APPEND dd.

*------- IMPORTANT

REFRESH ft.

ft-tabname = 'T001'.

ft-fieldname = 'BUTXT'.

APPEND ft.

ft-tabname = 'T001'.

ft-fieldname = 'WAERS'.

APPEND ft.

ft-tabname = 'T001'.

ft-fieldname = 'ORT01'.

APPEND ft.

*----


CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • ddic_structure = 'T001' "*----- IMPORTANT IF STANDARD STRUCT

retfield = 'BUKRS'

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = 'BUKRS'

value_org = 'S'

TABLES

field_tab = ft "*---- IMPORTANT

value_tab = t001

dynpfld_mapping = dd "* IMPORTANT

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

regards,

amit m.

Read only

0 Likes
1,326

Hi Amit!

I am supposed to do in Module pool program only.

Instead of return_tab what is the other alternative.

Please advise

regards

Praneeth

Read only

0 Likes
1,326

Hi Praneeth,

Check this Demp Program For F4 Help in Module pool, they used with out return tab.

<b>

DEMO_DYNPRO_F4_HELP_MODULE</b>

Regards

vijay

Read only

hymavathi_oruganti
Active Contributor
0 Likes
1,326

declare like this

DATA: RET_TAB TYPE STANDARD TABLE OF DDSHRETVAL.

1. Make sure that, the fields in the internal table which u r getting as F4 are <b>refernces to DDIC</b>

2. if still u r not getting , then try to fill the fiel-tab.

data:lT_FIELD type standard table of DFIES,

lt_field-fieldname = FIELDNAME.

lT_field-intlen = 100.

lT_field-leng = 30.

lT_field-outputlen = 30.

APPEND LT_FIELD.

3. PASS LT_FIELD TO FIELD_TAB.

4. NOW U CAN USE EITHER VALUE_ORG = 'S' OR 'C'. U WILL GET THE REQUIRED RESULT