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

Problem with transaction KOB1

Former Member
0 Likes
2,080

Hello,

I have a problem with transaction KOB1. My task is to add two new columns to the report, the vendor's number and name (fields LIFNR and NAME1 in table LFA1).

For that I modified the user exit ZOOMEP1 and the include ZXKAEPU01.

I managed getting the vendor's number and name by referring to the order-nr (field BESTNR), but unfortunately only few records have an order-nr.

But there's a field BELNR in every record, which should be a key to a costing-record.

Can anyone help me to get the vendor's data via this field BELNR?

For example the table's names, by which I can connect the data I need or perhaps even a function module.

I'm searching for a solution for a few days and meanwhile I don't know how to go one.

Thanks in advance.

Greets

Sven Sondag

1 ACCEPTED SOLUTION
Read only

andreas_mann3
Active Contributor
0 Likes
1,504

Hi,

try to select table bseg with field belnr and additionally bukrs and gjahr

in item with WE/RE account or G/L-account

look for bseg-ebeln

regards Andreas

5 REPLIES 5
Read only

andreas_mann3
Active Contributor
0 Likes
1,505

Hi,

try to select table bseg with field belnr and additionally bukrs and gjahr

in item with WE/RE account or G/L-account

look for bseg-ebeln

regards Andreas

Read only

Former Member
0 Likes
1,504

Hi Swen,

If you have BELNR field available, then you should have Fiscal year (GJAHR) and Company code (BUKRS) should also be available at the same place. These three fields form the key of a FI document. I have 2 options for you as below

1) If you have BUZEI which is the line item number of the document then you can directly access BSEG table ( with BUKRS, BELNR, GJAHR and BUZEI) and find the LIFNR and proceed for more details.

2) If you do not have BUZEI field accessible then Still you can access table BSEG, but in this case you look for BUKRS, BELNR GJAHR and KOART fields. KOART is account type whose value is 'K' for vendor. So you can access vendor from multiple line items using this.

You can use BSAK(cleared items) or BSIK(open items) table instead of BSEG if you know the document is cleared or open.

Regards,

Vin

Read only

0 Likes
1,504

Hi!

Unfortunately these are the solutions I already found out.

The BELNR you mean is type BELNR_D and just added to very few records. To get the LIFNR this way I wrote a query connecting tables EKKO and LFA1, that works quite fine.

This BELNR has 10 digits and the format is "45000xxxxx".

The key I need is the one to the costing-record. Help says: "Belegnummer - Schlüssel, mit dem auf einen Kostenrechnungsbeleg (z.B. Umbuchung von Kosten) zugegriffen wird."

The title in the report is "Belegnr" and it has 9 digits. At records with a BELNR_D this number has the format "200xxxxxx", at records without it is "600xxxxxx" or "900xxxxxx".

Thanks anyway.

Sven

Read only

andreas_mann3
Active Contributor
0 Likes
1,504

Hi,

1) costing records are in tables cobk and coep

2) you'll not found ebeln/bestnr in bsak/bsik only in

bseg

regards Andreas

Read only

Former Member
0 Likes
1,504

Hi..

The problem can't be solved, 'cause the records without EBELN are accumulated records or self-costs.

Greets

Sven