Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

relation EKKO VBAK

i have one requirement in which i have to link ekko-afnam and vbak-vbeln.

but data length of afnam is 12 and vbeln is 10, I am using for all entries it is not allowing, what could be the solution for that.

i am putting samplaecode also.

DATA : BEGIN OF IT_PO OCCURS 0,

EBELN TYPE EKKO-EBELN,

BSTYP TYPE EKKO-BSTYP,

BSART TYPE EKKO-BSART,

AEDAT TYPE EKKO-AEDAT,

LIFNR TYPE EKKO-LIFNR,

LLIEF TYPE EKKO-LLIEF,

EBELP TYPE EKPO-EBELP,

WERKS TYPE EKPO-WERKS,

AFNAM(10) type C, "ekpo-AFNAM,

END OF IT_PO.

DATA: BEGIN OF IT_SALE OCCURS 0,

VBELN TYPE vbak-vbeln,

KUNNR TYPE VBAK-KUNNR,

END OF IT_SALE.

SELECT-OPTIONS: S_DATE FOR EKKO-AEDAT,

s_ebeln for ekko-ebeln.

SELECT

A~EBELN

A~BSTYP

A~BSART

A~AEDAT

A~LIFNR

A~LLIEF

B~EBELP

B~WERKS

B~AFNAM

INTO TABLE IT_PO

FROM EKKO AS A INNER JOIN

EKPO AS B

ON AEBELN = BEBELN

WHERE A~AEDAT IN S_DATE

and a~ebeln in s_ebeln.

IF IT_PO[] IS NOT INITIAL.

SELECT

VBELN

KUNNR

INTO TABLE IT_SALE

FROM VBAK

FOR ALL ENTRIES IN IT_PO

WHERE VBELN = IT_PO-AFNAM.

endif.

please response.

Tags:
Not what you were looking for? View more on this topic or Ask a question