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

Obsolete Statements

Former Member
0 Likes
949
DATA: wa_zcitorderout TYPE STANDARD TABLE OF zcitorderout
                      INITIAL SIZE 0
                      WITH HEADER LINE.

This is an obsolete statement in my code. By changing it to


DATA: wa_zcitorderout TYPE STANDARD TABLE OF zcitorderout.

It gives me error that wa is not table with header. How do I rewrite the code

1 ACCEPTED SOLUTION
Read only

ferry_lianto
Active Contributor
0 Likes
921

Hi,

Please try this.


DATA: it_zcitorderout TYPE STANDARD TABLE OF zcitorderout.
DATA: wa_zcitorderout LIKE LINE of it_zcitorderout.
 
LOOP AT i_custinfo INTO i_custinfo_temp.
  clear  wa_zcitorderout.
  wa_zcitorderout-kunnr = i_custinfo_temp-kunnr.
  wa_zcitorderout-vbeln = i_custinfo_temp-vbeln.
  wa_zcitorderout-erdat = i_custinfo_temp-erdat.
  wa_zcitorderout-erzet = i_custinfo_temp-erzet.
  wa_zcitorderout-flag = 'I'.
  APPEND wa_zcitorderout to it_zcitorderout.
ENDLOOP.

Regards,

Ferry Lianto

9 REPLIES 9
Read only

Former Member
0 Likes
921
DATA: wa_zcitorderout TYPE STANDARD TABLE OF zcitorderout with header line.

If u want to declare workarea then just use

wa_zcitorderout TYPE zcitorderout

Message was edited by:

Chandrasekhar Jagarlamudi

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
921

The idea here is to have two separate objects, the internal table and the work area. So define like so.

DATA: it_zcitorderout TYPE STANDARD TABLE OF zcitorderout.
DATA: wa_zcitorderout like line of  it_zcitorderout.

Then when working with your internal table, do this.

Loop at it_zcitorderout into wa_zcitorderout.
  ...
Endloop.

Regards,

RIch Heilman

Read only

Former Member
0 Likes
921

hi,

give this way

DATA: wa_zcitorderout TYPE STANDARD TABLE OF zcitorderout <b>with header line.</b>

Read only

Former Member
0 Likes
921

Hi,

You can write it as:


DATA: it_zcitorderout TYPE STANDARD TABLE OF zcitorderout.
DATA: wa_zcitorderout LIKE LINE of it_zcitorderout.

or 

DATA: it_zcitorderout TYPE STANDARD TABLE OF zcitorderout.
DATA: wa_zcitorderout TYPE zcitorderout.

Along with the above change, you may have to change the code where you are using the READ or LOOP on this itab.

You must add the INTO option.

For example:

LOOP AT it_zcitorderout INTO wa_zcitorderout.

....

ENDLOOP.

Hope this helps,

Sumant.

Read only

Former Member
0 Likes
921

Hi,

Look at the below link, this will have all everything related to your question

http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb3646358411d1829f0000e829fbfe/content.htm

Regards

Sudheer

Read only

Former Member
0 Likes
921

This is my code

*------------- Work Area of storage table -----------------------------*
DATA: wa_zcitorderout TYPE STANDARD TABLE OF zcitorderout
                      INITIAL SIZE 0
                      WITH HEADER LINE.

LOOP AT i_custinfo INTO i_custinfo_temp.
  wa_zcitorderout-kunnr = i_custinfo_temp-kunnr.
  wa_zcitorderout-vbeln = i_custinfo_temp-vbeln.
  wa_zcitorderout-erdat = i_custinfo_temp-erdat.
  wa_zcitorderout-erzet = i_custinfo_temp-erzet.
  wa_zcitorderout-flag = 'I'.
  APPEND wa_zcitorderout.
ENDLOOP.

I have 2 obsolete statements here and I need to change them so I meet extended program check.

Tables with headers are no longer supported in OO

An explicit work area is neccesary in OO. Use Append wa to wa_zcitorderout

Read only

0 Likes
921
change to this


DATA: it_zcitorderout TYPE STANDARD TABLE OF zcitorderout
                      INITIAL SIZE 0
                      WITH HEADER LINE,
          it_zcitorderout TYPE zcitorderout .
 
LOOP AT i_custinfo INTO i_custinfo_temp.
  wa_zcitorderout-kunnr = i_custinfo_temp-kunnr.
  wa_zcitorderout-vbeln = i_custinfo_temp-vbeln.
  wa_zcitorderout-erdat = i_custinfo_temp-erdat.
  wa_zcitorderout-erzet = i_custinfo_temp-erzet.
  wa_zcitorderout-flag = 'I'.
  APPEND wa_zcitorderout to it_zcitorderout.
ENDLOOP.
Read only

0 Likes
921

hi ,

Change your code this way then

DATA: it_zcitorderout TYPE STANDARD TABLE OF zcitorderout with header line.
     
data : wa_zcitorderout like it_zcitorderout.
                      
 
LOOP AT i_custinfo INTO i_custinfo_temp.
  wa_zcitorderout-kunnr = i_custinfo_temp-kunnr.
  wa_zcitorderout-vbeln = i_custinfo_temp-vbeln.
  wa_zcitorderout-erdat = i_custinfo_temp-erdat.
  wa_zcitorderout-erzet = i_custinfo_temp-erzet.
  wa_zcitorderout-flag = 'I'.
   APPEND it_zcitorderout  from wa_zcitorderout.
ENDLOOP.

Regards,

Santosh

Read only

ferry_lianto
Active Contributor
0 Likes
922

Hi,

Please try this.


DATA: it_zcitorderout TYPE STANDARD TABLE OF zcitorderout.
DATA: wa_zcitorderout LIKE LINE of it_zcitorderout.
 
LOOP AT i_custinfo INTO i_custinfo_temp.
  clear  wa_zcitorderout.
  wa_zcitorderout-kunnr = i_custinfo_temp-kunnr.
  wa_zcitorderout-vbeln = i_custinfo_temp-vbeln.
  wa_zcitorderout-erdat = i_custinfo_temp-erdat.
  wa_zcitorderout-erzet = i_custinfo_temp-erzet.
  wa_zcitorderout-flag = 'I'.
  APPEND wa_zcitorderout to it_zcitorderout.
ENDLOOP.

Regards,

Ferry Lianto