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

getting filled with

Former Member
0 Likes
1,078

Hi all,

I 'm using below shown coding as you can see.

I'm deeply interested in how this value request

is getting filled with the Org. units.

Which tables are affected ?

And where is the location in the code for filling based on these affected tables

for Org. units.

I' m asking because I'm demand to know whether I can take another table

e.g. Z_Extern_Org_Unit_Tab in order to fill the value request ?

Regards

Ertas

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

*  CALL FUNCTION 'RP_PNP_ORGSTRUCTURE'
*    TABLES
*      pobjid = r_pobjid.

CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
  EXPORTING
    tabname                   = 'M_PREMK'
    fieldname                 = 'ORGEH'
 TABLES
   RETURN_TAB                = gt_DDSHRETVAL
* 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.

read table gt_DDSHRETVAL into gw_DDSHRETVAL INDEX 1.
p_orgeh-low = gw_DDSHRETVAL-FIELDVAL.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,034

This help values are coming from the Value table attached to the Domain of the Data Element of Field ORGEH.

Table Name = M_PREMK.

Field Name = ORGEH.

Data Element = ORGEH.

Domain = ORGEH.

Value Table used = T527X.

Have a look at this last value table and you will come to know wher these values come from.

Now if you wan to display values from table Z_Extern_Org_Unit_Tab , you cant use the Domain directly. In this case wat u can do is, comment the current F/M call and code the foll:

select orgeh into table lt_tab from Z_Extern_Org_Unit_Tab where <ur conditions, if any>.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'ORGEH'

dynpprog = sy-cprog

dynpnr = sy-dynnr

dynprofield = <ur screen field name>

value_org = 'S'

TABLES

value_tab = gt_DDSHRETVAL

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

Reward if useful.

Thanks,

Pranjal.

Edited by: Pranjal Gadkari on Apr 30, 2008 11:54 AM

7 REPLIES 7
Read only

Former Member
0 Likes
1,035

This help values are coming from the Value table attached to the Domain of the Data Element of Field ORGEH.

Table Name = M_PREMK.

Field Name = ORGEH.

Data Element = ORGEH.

Domain = ORGEH.

Value Table used = T527X.

Have a look at this last value table and you will come to know wher these values come from.

Now if you wan to display values from table Z_Extern_Org_Unit_Tab , you cant use the Domain directly. In this case wat u can do is, comment the current F/M call and code the foll:

select orgeh into table lt_tab from Z_Extern_Org_Unit_Tab where <ur conditions, if any>.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'ORGEH'

dynpprog = sy-cprog

dynpnr = sy-dynnr

dynprofield = <ur screen field name>

value_org = 'S'

TABLES

value_tab = gt_DDSHRETVAL

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

Reward if useful.

Thanks,

Pranjal.

Edited by: Pranjal Gadkari on Apr 30, 2008 11:54 AM

Read only

0 Likes
1,034

Prnajal,

is there no possibilitiy to pass lt_tab to FM ?

select orgeh into table lt_tab from Z_Extern_Org_Unit_Tab where <ur conditions, if any>.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'ORGEH'
dynpprog = sy-cprog
dynpnr = sy-dynnr
dynprofield = <ur screen field name>
value_org = 'S'
TABLES
value_tab = gt_DDSHRETVAL
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.

Regards

ertas

Read only

0 Likes
1,034

Oh sorry, in the tables parameter, the gt_DDSHRETVAL that i have mentioned has to be actually lt_itab.

When you select a particular entry frm that F4 list, it will be returned in the header line of this lt_itab or you can use the TABLES parameter RETURN_TAB of the F/M to get the selected value.

Did this help you?

Pranjal.

Read only

Former Member
0 Likes
1,034

hi,

plz go through this sample code

at selection-screen on value-request for p_kunnr.

select kunnr

from vbak

into table i_kunnr.

call function 'F4IF_INT_TABLE_VALUE_REQUEST'

exporting

retfield = 'SOLD-TO-PARTY'

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = 'P_KUNNR'

value_org = 'S'

tables

value_tab = i_kunnr

exceptions

parameter_error = 1

no_values_found = 2

others = 3.

if sy-subrc <> 0.

endif.

in this code first u fetch all the values for f4 help into table i_kunnr and pass those values to p_kunnr

the assigning of thes values done internally in source code of FM . if u want that check it in debugging .

reward if helpful.

regards,

chandu

Read only

Former Member
0 Likes
1,034

Hi,

This FM permits the implementation of the standard help for a screen field whose reference to the ABAP Dictionary is only known at runtime. It is called at the time PROCESS ON VALUE REQUEST, it behaves just like the standard help. The reference to the ABAP Dictionary is needed in the form of the table and field names as input. This then determines the search help defined directly or indirectly in the Dictionary (e.g. also domain fixed values). If several parameters of the search help are linked with the Dictionary table or structure, the additional fields are searched for on the screen, as for the standard help, and the parameters are given their contents. The standard F4 process is then started. Depending on the user settings, this can also be implemented with the input help Control.

In addition to specifying the table and field names, you have the following alternatives:

• Parameter TABNAME is assigned a data element (type). FIELDNAME is empty.

• The search help (SEARCHHELP) is specified directly. In this case you should also pass the search help parameter (SHLPPARAM), which is used as return parameter. (For reasons of compatibility, you can also define only SEARCHHELP. In this case the first parameter of the search help is used as default for SHLPPARAM.)

If the screen information DYNPPROG, DYNPNR, DYNPROFIELD and possibly STEPL is also specified, the selected value is automatically stored in the screen field. Further export parameters are also stored there if they are found as input fields on the screen.

If the user activated the ActiveX help, the help is started automatically under the following conditions:

1. The screen information DYNPROG, DYNPNR and DYNPROFIELD must be defined.

2. When the function module is called, the RETURN_TAB may not be specified. (If the call is automatic, the function module returns before the user has specified a value.)

Normally values are only returned in input fields. This behavior can be influenced with the parameter DISPLAY .

If you need further information, revert back .

Reward all the helpful answrrs.

Regards

Nagaraj T

Read only

Former Member
0 Likes
1,034

Pranjal

gt_DDSHRETVAL is a return tab isn't it ? You can't pass your table from select result to this paramter.

In case of being a changing Parameter it would be possible.

Regards

ertas

Read only

0 Likes
1,034

No, its not a RETURNS table, it is a parameter in the TABLES list, which means, it can be either importing, exporting or both.

In our case, the value_tab is the table which we pre-poulate and send to the F/M , whereas result_tab is the table whch the f/m returns, with the selected row.

If you read the documentation of the F/M F4IF_INT_TABLE_VALUE_REQUEST, you will understand the meaning of these tables better.

You try the code given and you will see that it will work.