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

FM for Table Control?

Former Member
0 Likes
818

Hello,

Im working on a field exit, Im trying to get the value that is into a table control. I already know the table control“s name, but I havent been able to get its values.

I tryed with FM DYNP_VALUES_READ, but it throws exception saying that the field doesnt exist.

I wonder if there is a FM to get the TC“s values if if give the program“s name, dynpro“s number and TC“s name,

does any body know it?

The tx Im working on is BP, and the TC“s name is TCTRL_BUT0IF,

Thanks

Gabriel P.

7 REPLIES 7
Read only

Former Member
0 Likes
776

Hi,

are you talking about the fm to show F4 help.

if so check this FM <b>F4IF_INT_TABLE_VALUE_REQUEST</b>

regards

vijay

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
776

I doubt it. Since a table control is a representation of an internal table, mostly likly there is an ITAB being used in the program which is holding all of the data. Maybe you can access the ITAB directly.

Regards,

Rich heilman

Read only

Former Member
0 Likes
776

Hello Rich,

Do you know a FM that given the program id and dynpro number returns the dynpro“s field names?

Thanks,

Gabriel P.

Read only

0 Likes
776

Check this sample program.



report zrich_0001 .

data: dynname(44) type c.

data: begin of h.                      "Header
        include structure d020s.
data: end of h.
data: begin of f occurs 250.           "Dynpro Fields
        include structure d021s.
data: end of f.
data: begin of m occurs 3.             "Match codes (if any)
        include structure d023s.
data: end of m.
data: begin of e occurs 0.             "Dynpro Logic
        include structure d022s.
data: end of e.

parameters: p_pgmnm(30) type c,
            p_dynnr(4) type n.

move p_pgmnm to dynname(40).
move p_dynnr to dynname+40(4).


import dynpro h f e m id dynname.

loop at f.
  write:/ f-fnam(30), f-stxt(60).
endloop.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
776

Are you passing the index value when you are specifying the field in the table control? I don't think you can simply refer to tabcontrol-fieldname. You may have to also specify which line like tabcontrol-fieldname(01) for the first line's field value.

Srinivas

Read only

Former Member
0 Likes
776

Hello Srinivas,

Yes, I wrote the field exit code like this:

DATA: pantalla LIKE dynpread OCCURS 0 WITH HEADER LINE.

pantalla-fieldname = 'GT_BUT0ID-IDNUMBER(01)'.

APPEND pantalla.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = 'SAPLBUS_LOCATOR'

dynumb = '3000'

TABLES

dynpfields = pantalla.

IF sy-subrc <> 0.

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

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

ENDIF.

DATA: linea(255) TYPE c.

READ TABLE pantalla INDEX '1'.

linea = pantalla-fieldvalue.

But it throws the exception I said before (Exception condition "INVALID_DYNPROFIELD" raised), as you see I indexed the table control with (01), I did it with out it also, but it raised the same exception.

What I see is that the value I need to get is into a table control, and I“m not sure how can I get that value.

Thanks a lot for your help,

Gabriel

Read only

0 Likes
776

Hi Gabriel,

Can't you try with

GET CURSOR LINE <lin>

or

GET CURSOR FIELD <f> LINE <lin>

and then read the table control values for that line.

Regards,

Vicky