Skip to Content
avatar image
Former Member

How to get cdpos tabkey into corresponding fields?

Hi All,

i need to get corresponding fields from cdpos-tabkey dynamically.

say for example i need to get plant,material etc from tabkey.

i tried so far the below code.

i am getting type conflict error when i use MOVE statement ,

when i use assignment statement , values is getting assign just like variables not like structure format , hence i couldn't able to get exact field from structure.

FIELD-SYMBOLS <table> TYPE any.

              DATA ls_data TYPE REF TO data.

            SELECT SINGLE * FROM dd03m INTO ls_dd03m

                   WHERE tabname   = t_cdpos-tabname

                     AND fieldname = 'WERKS'.

              IF sy-subrc = 0.

                    CREATE DATA ls_data TYPE (t_cdpos-tabname).

                     ASSIGN ls_data->* TO <table>.

*                        MOVE-CORRESPONDING t_cdpos-tabkey TO <table>.

*                     <table> = t_cdpos-tabkey.

                     ASSIGN t_cdpos-tabkey to <table>.

              ENDIF.

anyone please help me to solve.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jun 12, 2017 at 08:46 AM

    You seem to be making this overly complicated, is there a particular reason?

    Call FM CHANGEDOCUMENT_READ to get change data. If you need to read the corresponding table record from the DB, do:

    select single * from (table_name) into data(table_row).
    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      To be more clear i need to display change document plant wise , i have got all data's only bottle neck is separating plant and other details from tabkey without using offset method.