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

Problem FIELD-SYMBOL with HASHED TABLE

Former Member
0 Likes
1,507

Hello gurus,

I have a problem with the following code. It is called in method MB_DOCUMENT_BEFORE_UPDATE of badi MB_DOCUMENT_BADI. I need to read the serial numbers of all items. I tried to do it with a field symbol. The information I need is stored in the hased table (SAPLMIGO)LCL_MIGO_GLOBALS=>KERNEL->PT_GOSERIAL_KERNEL. The systems returns sy-subrc = 4 after the assign. Can anyone help me? Thanks!

TYPES: BEGIN OF ty_s_goserial,
          selected TYPE xfeld,
          serialno TYPE    gernr,
        END OF ty_s_goserial,
        ty_t_goserial  TYPE STANDARD TABLE OF ty_s_goserial WITH
                                                 NON-UNIQUE DEFAULT KEY.

  TYPES: BEGIN OF ty_s_goserial_kernel,
            global_counter TYPE migo_global_counter,
            t_goserial TYPE ty_t_goserial,
        END OF ty_s_goserial_kernel.

 types: tyt_goserial TYPE HASHED   TABLE OF ty_s_goserial_kernel
                                 WITH UNIQUE KEY global_counter.

    fs_l_serialno = '(SAPLMIGO)LCL_MIGO_GLOBALS=>KERNEL->PT_GOSERIAL_KERNEL'.

    FIELD-SYMBOLS: <fs_serialno> type tyt_goserial.

    ASSIGN (fs_l_serialno) TO <fs_serialno>.

    IF sy-subrc = 4.

      WRITE: / 'Ouch...'.

    ENDIF.

Hello gurus,

I have a problem with the following code. It is called in method MB_DOCUMENT_BEFORE_UPDATE of badi MB_DOCUMENT_BADI. I need to read the serial numbers of all items. I tried to do it with a field symbol. The information I need is stored in the hased table (SAPLMIGO)LCL_MIGO_GLOBALS=>KERNEL->PT_GOSERIAL_KERNEL. The systems returns sy-subrc = 4 after the assign. Can anyone help me? Thanks!

TYPES: BEGIN OF ty_s_goserial,
          selected TYPE xfeld,
          serialno TYPE    gernr,
        END OF ty_s_goserial,
        ty_t_goserial  TYPE STANDARD TABLE OF ty_s_goserial WITH
                                                 NON-UNIQUE DEFAULT KEY.

  TYPES: BEGIN OF ty_s_goserial_kernel,
            global_counter TYPE migo_global_counter,
            t_goserial TYPE ty_t_goserial,
        END OF ty_s_goserial_kernel.

 types: tyt_goserial TYPE HASHED   TABLE OF ty_s_goserial_kernel
                                 WITH UNIQUE KEY global_counter.

    fs_l_serialno = '(SAPLMIGO)LCL_MIGO_GLOBALS=>KERNEL->PT_GOSERIAL_KERNEL'.

    FIELD-SYMBOLS: <fs_serialno> type tyt_goserial.

    ASSIGN (fs_l_serialno) TO <fs_serialno>.

    IF sy-subrc = 4.

      WRITE: / 'Ouch...'.

    ENDIF.

6 REPLIES 6
Read only

Former Member
0 Likes
1,007

Hi,

Try adding body operator..at the end as it is an internal table..

(SAPLMIGO)LCL_MIGO_GLOBALS=>KERNEL->PT_GOSERIAL_KERNEL[]'.

Thanks

Naren

Read only

Former Member
0 Likes
1,007

ignore...

Thanks

Naren

Edited by: Narendran Muthukumaran on Dec 18, 2008 8:28 PM

Read only

0 Likes
1,007

Hi, did you find a solution ?

I have the same problem, i can't assign my field symbol.

Read only

0 Likes
1,007

Hi, I solve the problem in another way

thanks , bye

Read only

0 Likes
1,007

Hi Gustavo,

Mind sharing with me how you solved this?

It would be of great help!

Thanks..

Regards,

Neesha

Read only

0 Likes
1,007

You can get the exporting tables from method LINE_GET with this code sample below

  DATA: lv_class  TYPE string,
        lv_method TYPE string,
        lv_line   TYPE sytabix.
  FIELD-SYMBOLS: <fs_kernel> TYPE any.
  lv_class = '(SAPLMIGO)LCL_MIGO_GLOBALS=>KERNEL'.
  lv_method = 'LINE_GET'.
  ASSIGN (lv_class) TO <fs_kernel>.
  DATA lr_o TYPE REF TO object.

  IF <fs_kernel> IS ASSIGNED  .
    lr_o ?= <fs_kernel>.
    lv_line = i_line_id.
    CALL METHOD lr_o->(lv_method)
      EXPORTING
        i_line      = lv_line " The line ID from the PBO_DETAIL parameter
        i_dependent_tables  = abap_true
      IMPORTING
        et_goserial = lt_serial.

ENDIF.