Application Development 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: 

Trying to sue c_T_data in user EXIT_SAPLRSAP_001

Former Member
0 Kudos

I have some code that keeps failing when I set my interal table to the global table c_t_data. here is the code. It says they are not compatible but i have used this before. any ideas

DATA : T_MCVBAK TYPE TABLE OF MCVBAK,

T_VBPA TYPE STANDARD TABLE OF TY_VBPA,

*-- Work Area

W_MCVBAK TYPE MCVBAK,

W_VBPA TYPE TY_VBPA.

WHEN '2LIS_11_VAHDR'. "RETRIEVING THE EXTRACTOR

REFRESH: T_MCVBAK,

T_VBPA.

CLEAR: W_VBPA,

L_TABIX.

T_MCVBAK[] = C_T_DATA[]. fails here!!!!!

SELECT VBELN

KUNNR

PARVW

INTO TABLE T_VBPA

FROM VBPA

FOR ALL ENTRIES IN T_MCVBAK

WHERE VBELN = T_MCVBAK-VBELN.

IF NOT T_VBPA IS INITIAL.

SORT T_VBPA BY VBELN KUNNR PARVW.

CLEAR: W_MCVBAK,

W_VBPA.

LOOP AT T_MCVBAK INTO W_MCVBAK.

L_TABIX = SY-TABIX.

READ TABLE T_VBPA INTO W_VBPA WITH KEY VBELN = W_MCVBAK-VBELN BINARY SEARCH.

IF SY-SUBRC = 0. "IF READ TABLE IS SUCESSFULL

  • START OF FILLING THE ZFIELDS CREATED

CASE W_VBPA-PARVW.

WHEN 'CR'. "Forwarding Agent

W_MCVBAK-ZZCR_FRAGNT = W_VBPA-KUNNR.

MODIFY T_MCVBAK FROM W_MCVBAK INDEX L_TABIX.

WHEN 'EU'. "End User

W_MCVBAK-ZZEU_ENDUSR = W_VBPA-KUNNR.

MODIFY T_MCVBAK FROM W_MCVBAK INDEX L_TABIX.

WHEN 'Z1'. "Sales Rep

W_MCVBAK-ZZ1_SLSREP = W_VBPA-KUNNR .

MODIFY T_MCVBAK FROM W_MCVBAK INDEX L_TABIX.

WHEN 'Z2'. "Sales Rep-2

W_MCVBAK-ZZ2_SLSREP = W_VBPA-KUNNR.

MODIFY T_MCVBAK FROM W_MCVBAK INDEX L_TABIX.

WHEN 'ZA'. "Agent

W_MCVBAK-ZZA_AGENT = W_VBPA-KUNNR.

MODIFY T_MCVBAK FROM W_MCVBAK INDEX L_TABIX.

WHEN 'ZC'. "Bemis Frt Forwarder

W_MCVBAK-ZZC_FRTFOR = W_VBPA-KUNNR.

MODIFY T_MCVBAK FROM W_MCVBAK INDEX L_TABIX.

WHEN 'ZF'. "Cust Frt Forwarder

W_MCVBAK-ZZF_CFRTFO = W_VBPA-KUNNR.

MODIFY T_MCVBAK FROM W_MCVBAK INDEX L_TABIX.

WHEN 'ZI'. "Intermediate Consign

W_MCVBAK-ZZI_INTCON = W_VBPA-KUNNR.

MODIFY T_MCVBAK FROM W_MCVBAK INDEX L_TABIX.

WHEN 'ZS'. "Customer Service Rep

W_MCVBAK-ZZS_CSEREP = W_VBPA-KUNNR.

MODIFY T_MCVBAK FROM W_MCVBAK INDEX L_TABIX.

WHEN 'ZX'. "Canadian Importer

W_MCVBAK-ZZX_CANIMP = W_VBPA-KUNNR.

MODIFY T_MCVBAK FROM W_MCVBAK INDEX L_TABIX.

WHEN 'SB'. "Special Stock Customer

W_MCVBAK-ZZSB_SPSTKC = W_VBPA-KUNNR.

MODIFY T_MCVBAK FROM W_MCVBAK INDEX L_TABIX.

WHEN OTHERS.

EXIT.

ENDCASE.

  • END OF FILLING THE ZFIELDS CREATED

ENDIF. "ENDIF FOR READ TABLE IS SUCESSFULL

CLEAR: W_MCVBAK,

L_TABIX,

W_VBPA.

ENDLOOP. "ENDLOOP FOR T_MCVBAK

ENDIF. "ENDIF FOR T_VBPA NOT INITIAL

REFRESH C_T_DATA.

C_T_DATA[] = T_MCVBAK[].

REFRESH: T_MCVBAK,

T_VBPA.

          • End of code by EXT_SAP_149 for RBW-133 with Transport request number ED1k902514*****

WHEN OTHERS.

EXIT.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

I think your structure for T_MCVBAK is incorrect, try this:

DATA: T_MCVBAK TYPE TABLE OF MC11VA0HDR.

6 REPLIES 6

Former Member
0 Kudos

I think your structure for T_MCVBAK is incorrect, try this:

DATA: T_MCVBAK TYPE TABLE OF MC11VA0HDR.

0 Kudos

That was it, thanks. do you happen to know what this error means? It is in German, so don't know how to translate

Include ZXRSAU01

Bei der Verwendung von FOR ALL ENTRIES wird die Längenangabe für

"FISCPER" in dieser Bedingung ignoriert.

0 Kudos

Hi Mick,

Try using babelfish for the translation - it isn't 100% accurate but it helps give some hints to the meaning

"When using FOR ALL ENTRIES is ignored the length specification for "FISCPER" in this condition"

ps. please assign points if it answered your initial question

LucianoBentiveg
Active Contributor
0 Kudos

Try defining T_MCVBAK like this:


DATA: BEGIN OF T_MCVBAK OCCURS 0.
        INCLUDE STRUCTURE MCVBAK.
DATA: END OF T_MCVBAK.

Regards.

Former Member
0 Kudos

Mick, look in RSA6 for the extraction structure of '2LIS_11_VAHDR'.

It is in fact MC11VA0HDR.

So C_T_DATA has the same structure, and that is the one that is compatible.

ferry_lianto
Active Contributor
0 Kudos

Hi,

Is C_T_DATA same structure as T_MCVBAK?

If it is, please try this.


FIELD-SYMBOLS: <FS_DATA> TYPE ANY TABLE.
ASSIGN C_T_DATA[] TO <FS_DATA>.

T_MCVBAK[] = <FS_DATA>[].

UNASSIGN <FS_DATA>.

...

Regards,

Ferry Lianto