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: 

Dump while importing an internal Table to a BADI method.

Former Member
0 Kudos

Hi All,

We came across an issue where if we are Importing an Internal Table(BAN)

from Main Program "SAPFM06B" through a memory ID 'ZYX' to BADI "ME_SOURCE_CHECK" it is giving Dump as:

Runtime Errors: CONNE_IMPORT_WRONG_STRUCTURE

Exceptn : CX_SY_IMPORT_MISMATCH_ERROR

whwere as in the same export one structure "COM" is passed with same memory ID 'ZYX' and we are able to import this in the BADI "ME_SOURCE_CHECK".

We checked the structure of both the internal table its acjectly same.

Could you please assist in identifying the issue.

Below is the Internal Table for BAN and Structure for COM.

DATA: BEGIN OF ban OCCURS 100.

INCLUDE STRUCTURE eban.

DATA: updk1 LIKE t16la-updkz, "Status der Zuordnung

updk2 LIKE t16la-updkz, "Status der Zuordnung (alt)

updk3 LIKE t16la-updkz, "Sicherungsstatus

selkf(2) TYPE p, "Kz. für Sammelfreigabe

selkz, "Selektiert ja/nein

szeil LIKE sy-curow, "Zeilennr. des Selektionskz.

zeile LIKE sy-curow, "Zeilennr. der Zuordnungsinfo

page LIKE sy-pagno, "Seite

aenda, "Kz. Berecht. für Änderungsbeleg

bukrs LIKE ekko-bukrs, "Buchungskreis für Buchungskreisüb.

slief LIKE eban-flief, "Lieferant für Sortierung

bkmkz, "Art der Kontierung "4.0C

kont1(24), "Kontierungsfeld 1 "4.0C

kont2(8), "Kontierungsfeld 2

bkuml, "Kz. Bukrs-übergreifende Umlagerung

az_pos TYPE i, "Anzahl Pos. pro Banf

sl_pos TYPE i, "Anzahl selektierter Pos. pro Banf

arch_date LIKE sy-datlo, "Archivierungsdatum "TK 4.0B EURO

END OF ban.

DATA: BEGIN OF COM,

FRGAB LIKE RM06B-FRGAB,

SRTKZ,

BKMKZ,

LSTUB LIKE T16LL-LSTUB,

ZPFKEY LIKE SY-PFKEY,

ZFMKEY(3),

GPFKEY LIKE SY-PFKEY,

GFMKEY(3),

CALLD LIKE SY-CALLD,

END OF COM.

5 REPLIES 5

Former Member
0 Kudos

Hi Pankaj,

You can't pass the table with header line to BADI as it is ABAP OO.

Change your table defination in the program.

Reward points if useful.

Regards,

Atish

uwe_schieferstein
Active Contributor
0 Kudos

Hello Pankaj

If you are able to change the EXPORT statement in program SAPFM06B then simply change the exported itab as following:

" Define type for BAN data
TYPES: BEGIN OF ty_s_ban.
INCLUDE TYPE eban.
TYPES: updk1     TYPE t16la-updkz.  " NOTE: use TYPE instead of LIKE !!!
TYPES: ...
TYPES: arch_date TYPE sy-datlo.
TYPES: END OF ty_s_ban.
TYPES: ty_t_ban   TYPE STANDARD TABLE OF ty_s_ban
                             WITH DEFAULT KEY.

DATA:
  lt_ban    TYPE ty_t_ban.

  lt_ban  = ban[].  " itab WITHOUT header line !!!

  EXPORT eban FROM lt_ban TO MEMORY ID 'ZYX'.

Within your BAdI method add to following coding:

" Add type definition as shown below

  IMPORT eban TO lt_ban FROM MEMORY ID 'ZXY'.

If you cannot change the EXPORT statement then simply call a function module within your BAdI method which imports the EBAN data from the memory. There you should not have any problems with header lines.

Regards

Uwe

0 Kudos

Hi Uwe ,

Thanks you very much for your reply.

I checked for the FM to import the EBAN data and found one "ME_FILL_EBAN_FROM_BQPEX" but the current structure BQPEX is not carrying the data needed to fill EBAN.

Could you please suggest any other FM for the same.

Thanks

Pankaj Bonde

0 Kudos

Hello Pankaj

I did no mean to use a standard function module but write and code your own customer function module.

" Coding within your BAdI (as in my previous posting)

" Type definition for ty_s_eban
...
DATA:
  lt_ban        TYPE ty_t_eban.


  CALL FUNCTION 'Z_GET_EBAN_FROM_MEMORY'
    EXPORTING
      id_memid = 'ZXY'    " define id_memid of type MEMID
    TABLES
      et_eban   = lt_ban.  " define et_eban of type TABLE

" Coding within your function module

  REFRESH: et_ban.
  IMPORT eban TO et_ban[] FROM MEMORY ID id_memid.

Regards

Uwe

Former Member
0 Kudos

BADI works on OOPS concept.

in sap abap oops validation is very strict.

so always use TYPE not LIKE

always use internal without header

always use work area