This website is not affiliated with, sponsored by, or approved by SAP AG.

Declaration of internal table structure in ALV

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

Declaration of internal table structure in ALV

Postby dineshreddy » Tue Apr 22, 2014 3:56 pm

Code: Select all
TYPES : BEGIN OF VBAK_TAB OCCURS 0 ,
        VBELN LIKE VBAK-VBELN,
        ERDAT LIKE VBAK-ERDAT,
        VKORG LIKE VBAK-VKORG,
        SPART LIKE VBAK-SPART,
        KUNNR LIKE VBAK-KUNNR,
        END OF VBAK_TAB.


How to declare internal table without using occurs 0 .
can i write like this ?


Code: Select all
DATA : it_vbak like standard table of vbak_tab ,  "internal table declaration
              wa_vbak like vbak_tab.   "work area declaration


if not , how can i write that ?
Last edited by Gothmog on Wed Apr 23, 2014 3:41 am, edited 2 times in total.
Reason: CAPSLOCK, code tags
dineshreddy
 
Posts: 1
Joined: Tue Apr 22, 2014 3:41 pm

Re: Declaration of internal table structure in ALV

Postby Gothmog » Wed Apr 23, 2014 3:46 am

First, do not SHOUT, and please use code tags when posting code.

As for your question:
- declare a structure type
- declare your work area and table as you wrote (but please use TYPE instead of LIKE)

Code: Select all
TYPES : BEGIN OF TY_VBAK,
          VBELN TYPE VBAK-VBELN,
          ERDAT TYPE VBAK-ERDAT,
          VKORG TYPE VBAK-VKORG,
          SPART TYPE VBAK-SPART,
          KUNNR TYPE VBAK-KUNNR,
        END OF TY_VBAK.

DATA : it_vbak type standard table of ty_vbak,  "internal table declaration
       wa_vbak type ty_vbak.   "work area declaration

You could also declare a table type base on the structure type and use this to type your table.
68 74 74 70 3a 2f 2f 74 69 6e 79 75 72 6c 2e 63 6f 6d 2f 62 64 6f 37 6d 77 67
Gothmog
 
Posts: 1941
Joined: Wed Sep 12, 2007 4:46 am
Location: Probably not home


Return to ABAP

Who is online

Users browsing this forum: Google [Bot] and 13 guests





loading...


This website is not affiliated with, sponsored by, or approved by SAP AG.