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

ABAP Accessing global data

former_member599326
Participant
0 Likes
1,085

Hi,

I am changing pricing routing RV61A902.

While debugging I come accross structure (SAPLIPWI)RIPWO of standard program SAPLV61A.

Basically I want to use value of field SERNR of the structure (SAPLIPWI)RIPWO in my coding.

But i dont know how to use this value ?

I tried to use like below , but getting error

FIELD-SYMBOLS : <fs_sernr> type any.

assign (SAPLIPWI)RIPWO-sernr to <fs_sernr>.

Can u pls help in this ??

Regards,


1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,037

Hi,

what error ar you getting.

Try definig the type for field symbol.

FIELD-SYMBOLS : <fs_sernr> type of  RIPWO.

constant: field(30) type c value '(SAPLIPWI)RIPWO'.

assign field to <fs_sernr>.

if <fs_sernr>  is assigned.

<fs_sernr>-sernr = .....

endif.

Regards

Sree

Hi,

I am changing pricing routing RV61A902.

While debugging I come accross structure (SAPLIPWI)RIPWO of standard program SAPLV61A.

Basically I want to use value of field SERNR of the structure (SAPLIPWI)RIPWO in my coding.

But i dont know how to use this value ?

I tried to use like below , but getting error

FIELD-SYMBOLS : <fs_sernr> type any.

assign (SAPLIPWI)RIPWO-sernr to <fs_sernr>.

Can u pls help in this ??

Regards,


6 REPLIES 6
Read only

Former Member
0 Likes
1,038

Hi,

what error ar you getting.

Try definig the type for field symbol.

FIELD-SYMBOLS : <fs_sernr> type of  RIPWO.

constant: field(30) type c value '(SAPLIPWI)RIPWO'.

assign field to <fs_sernr>.

if <fs_sernr>  is assigned.

<fs_sernr>-sernr = .....

endif.

Regards

Sree

Read only

0 Likes
1,037

I have put code as below : but getting error "Type RIPWO is unknown"

FIELD-SYMBOLS : <fs_sernr> type RIPWO.

constant: field(30) type c value '(SAPLIPWI)RIPWO'.

assign field to <fs_sernr>.

if <fs_sernr>  is assigned.

endif.

Read only

0 Likes
1,037

Hi,

Below code will help you.

FIELD-SYMBOLS : <fs_sernr> type any.

assign ('(SAPLIPWI)RIPWO') to <fs_sernr>.

IF <fs_sernr> IS ASSIGNED.

<fs_sernr>-sernr will hold the value.

ENDIF.

Regards

Gangadhar

Read only

0 Likes
1,037

I used code by gangadhar as below. but i am not able to use value of <fs_sernr>-sernr

it gives error "the data object <fs_sernr> has no structure and therefore no component called "SERNR".

   FIELD-SYMBOLS : <fs_sernr> type any.

data : lv_obknr type OBJKNR,
       lv_LIEF_NR type VBELN_VL,
       lv_vbeln type VBELN_NACH.

assign ('(SAPLIPW1)RIPW0') to <fs_sernr>.
IF <fs_sernr> IS ASSIGNED.
  clear lv_obknr.
  select single OBKNR
  into lv_obknr
  from OBJK
  where EQUNR = <fs_sernr>-sernr
  and   TASER = 'SER01'.

  if lv_obknr is not INITIAL.
    clear lv_LIEF_NR.
    select single LIEF_NR
    into lv_LIEF_NR
    from SER01
    where OBKNR = lv_obknr.

    if lv_LIEF_NR is not INITIAL.
      select single vbeln
      into lv_vbeln
      from vbfa
      where VBELV   = lv_LIEF_NR
      and   POSNV   = '000010'
      and   VBTYP_N = 'U'.
    endif.
  endif.


ENDIF.

Read only

0 Likes
1,037

Hi,

Can i knw your actual internal table....

field-sybols : <f> type (your internal table type).

loop at it assinging <f>.

<f>-sernr = (your value).

endloop.

Read only

0 Likes
1,037

your field-symbol is untyped (any). That means you can't access the field of the structure directly like this:

structure-field

you need to access it via another field-symbol, like you already did, so

assign component 'SERNR' of structure 'STRUCTURE' to <lv_any2> and then use this <lv_any2> in your where clause