Application Development and Automation 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: 
Read only

relation EKKO VBAK

Former Member
0 Likes
2,087

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.

6 REPLIES 6
Read only

Former Member
0 Likes
1,162

Hi

Get the relation from the table VBKD

field name VBELN and BSTKD.

Thanks,

Chidanand

Read only

Former Member
0 Likes
1,162

Hi,

I checked the above code its not giving any error. Can you paste what error you are getting. ?

Thanks & Regards,

Navneeth K.

Read only

0 Likes
1,162

when i debug i find some afnam value but it is not fetching data from vbak . that is error.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,162

Try to use

 WHERE vbeln = it_po-afnam+0(10)

(and remove the local definition of AFNAM length).

Regards

Read only

0 Likes
1,162

hi raymond,

i did that also its giving warning and not fetching data from vbak.

Read only

0 Likes
1,162

issue sloved