cancel
Showing results for 
Search instead for 
Did you mean: 

Internal table insiden BSP.

Former Member
0 Kudos

Hi,

Pretty new to BSP but have been working with ABAP for 2 months now...

Types definition:

types: begin of t_MasterDataStruct,

X_EKKO_EBELN type EKKO-EBELN,

X_EKKO_LIFNR type EKKO-EBELN,

X_EKKO_BEDAT type EKKO-BEDAT, " Huvudnivå, När po skapades..ikke intressant?

X_LFA1_NAME1 type LFA1-NAME1,

X_EKPO_EBELP type EKPO-EBELP, " Linje nr.

X_EKPO_MATNR type EKPO-MATNR,

X_EKPO_MENGE type EKPO-MENGE, " Totalt per linje

X_EKES_MENGE type EKES-MENGE, " Antal bekräftade per linje.

X_EKES_EINDT type EKES-EINDT, " Datum för bekräftat.

X_EKET_MENGE type EKET-MENGE, " Antal obekräftat per linje

X_EKET_EINDT type EKET-EINDT, " Datum för obekräftat

end of t_MasterDataStruct.

Eventhandler: oninitialization:

data: i_MasterDataTab type table of t_MasterDataStruct.

select

X_EKKO~EBELN

X_EKKO~LIFNR

X_EKKO~BEDAT " Huvudnivå, När po skapades..ikke intressant?

X_LFA1~NAME1

X_EKPO~EBELP " Linje nr.

X_EKPO~MATNR

X_EKPO~MENGE " Totalt per linje

X_EKES~MENGE " Antal bekräftade per linje.

X_EKES~EINDT " Datum för bekräftat.

X_EKET~MENGE " Antal obekräftat per linje

X_EKET~EINDT " Datum för obekräftat

from EKKO as X_EKKO

inner join LFA1 as X_LFA1 on X_LFA1LIFNR = X_EKKOLIFNR

inner join EKPO as X_EKPO on X_EKPOEBELN = X_EKKOEBELN

left outer join EKES as X_EKES on X_EKESEBELN = X_EKPOEBELN AND X_EKESEBELP = X_EKPOEBELP

left outer join EKET as X_EKET on X_EKETEBELN = X_EKPOEBELN AND X_EKETEBELP = X_EKPOEBELP

into corresponding fields of i_MasterDataTab

where

X_EKKO~EBELN = '5600000029'.

In my layout i want to make a loop and write everything (i_MasterDataTab) to screen.

Error: You cannot use an internal table as a work area.

How can I fix this problem ?

//Martin

Accepted Solutions (1)

Accepted Solutions (1)

thomasalexander_ritter
Active Contributor
0 Kudos

Hi Martin,

please check out the following topic:

I strongly suggest that you take a look at the example applications from SAP (especially SBSPEXT_TABLE). They are a great help to get you started. Furthermore take a look at this weblog which is aimed at beginners:

/people/brian.mckellar/blog/2004/06/11/bsp-trouble-shooting-getting-help

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Martin,

You declared a internal table named t_MasterDataStruct.In which section of BSP we have to declare the internal table?In LAYOUT or IN EVENT HANDLER

rainer_liebisch
Contributor
0 Kudos

Hi Martin,

from the ABAP point-of-view you have to loop over the internal table and assign each row to a work area. Then you write each row inside the loop.

In BSPs there's no need for a loop. You can display the whole internal table (or selected columns) directly in the browser by using the htmlb:tableview tag. For more information about this tag please look at the links Thomas already wrote.

Regards,

Rainer