cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance 2LIS_02_SCL with BLDAT from MKPF or EKBE

Former Member
0 Kudos

Hi i need to enhance the extractor 2LIS_02_SCL with MKPF-BLDAT or EKBE-BLDAT, but i don't know how to add this field, because the Purchasing Document (EBELN) and EBELP aren't unique key to enter in this table (they could have more material document with different BLDAT). so i think i have to use Schedule Line Counter (ETENR) to take the correct material document (MBLNR) and then use it to enter in this table... but i don't think how to do that..

Do you have any idea to solve this problem ?

Than you for your help.

Message was edited by: Alex Piva

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Please go to RSA6 and open the extract structre for 2lis_02_SCL and click on the append structure option you have in the application tool bar.

It will open the session there you need to name the structure to be appended and the fields to be included in that structure.

Please post message if there are any confusions.

Best Regards,

Vijay

Former Member
0 Kudos

Thank you for your help..

but i think the problem is different...

i know how to add the field in the structure of 2lis_02_Scl... but i need to insert not only the field but even the values of BLDAT; and i think i have to do that with CMOD.. and so write some abap code to enter in MKPF or EKBE but i don't know how to enter in this table with only EBELN EBELP, because i need even material document...

Is that correct ?

Message was edited by: Alex Piva

Former Member
0 Kudos

Hi,

can you check this Table MSEG by passing Purchase Document, Plant and Purchase Item Number. if it won't useful then you need to check the Quantity.

I think MSEG will satisfy your requirement.

Nagesh.

Former Member
0 Kudos

Hi,

can you tell me what exacltly you want to fill in BLDAT?

Lets assume this Scenario check with your team what exactly they want?

PO Number PO item Order Quantity

4500000001 0010 10

4500000001 0020 20.

for the PO Number 4500000001 and Item 0010.

MBLNR BLDAT Quantity PO Item

2300000001 01/04/2004 10 4500000001 0010

<b>2300000002 01/05/2004 10 4500000001 0020

2300000003 01/06/2004 5 4500000001 0020

<i>2300000004 01/06/2004 5 4500000001 0020</i></b>

If you check in MSEG table you will 3 Document Numbers for 4500000001 and 0020, what exactly you want to load?

do u want to load latest BLDAT? then what about others... i think u need to get all the BLDAT or none? there is no meaning for BLDAT in third line?

Check with your Business People? what exaclt they want? if They want date, Purchase order and Item number there could be Performence Problem.

If you look at the 2LIS_03_BF DS, DS is not extracting data by Material Document? if they maintain every document in BW... we need to face performence problem. SAP has provided BLDAT in the Inventory DS(BF).there we are extracting by date and other parameters not Document.

You are looking for Document wise. Please guide me if i'm wrong. Please update the thread how you resolved the issue.

All the best.

Regards,

Nagesh.

Former Member
0 Kudos

Thanks for the help.

i'll begin from your example.

i need a result like that:

PO Number PO item Order Quantity

4500000001 0010 10

4500000001 0020 20

BLDAT Quantity PO Item

01/04/2004 10 4500000001 0010

01/05/2004 10 4500000001 0020

01/06/2004 10 4500000001 0020

So i need to get all the BLDAT dates, while the user don't need to get material document.

i think using BF could be a solution, because i can't understand how to get this result with 2lis_02_scl (i want to use 02_scl, because the request of BLDAT was made after i've done the structure in BW; before i used BUDAT, that came from EKBE, so i hoped to find a way to get BLDAT from EKBE )

Former Member
0 Kudos

friend,

i think you need to do so much ground work for that i don'know how to achieve it. Check tis code. there is lot of scope to improve the performence.

In Enhancement, you can write like this

<i>LOOP AT DS INTO WORKAREA.

select doc number YEAR quantity from MSEG into doc_number year workarea-quantity where plant = DS-plant and EBELN = DS-PO and POSNR = DS-Item.

IF WORKAREA-BLDAT EQ SPACE. "for Item 10 & 20(quan 10 1st )

select SINGLE bldat from MKPF into Workarea-BLDAT where mbeln = doc_number adn FISCAL YEAR = YEAR.

MODIFY DS FROM WORKAREA.

ELSE. "for Item 20(quan 10 2nd)

APPEND DS FROM WORKAREA.

ENDIF.

endselect.

ENDLOOP.</i>

If you are uploading to ODS? then you need to make BLDAT as Primary Key.

please look into this code. I think we can implement this to achieve this.

Update the thread.

all the best.

Nagesh.

Former Member
0 Kudos

Very interesting..

i'll try to use this code...

Former Member
0 Kudos

Alex,

we need to some more changes to the code...?

1. take the case if PO Item contains Qty 20, u created material documents for 10. remaining 10 won't come to BW as per the code.

2. we need to see how BLDAT link to the other key figures such as quantity. Otherwise.. we will get data inconsistensy.

<b>Can you one Question to Users or Manager? how they will use this BLDAT i mean what are the reporting requirements.what values they will display using BLDAT?</b>

all the best.

Nagesh.

Former Member
0 Kudos

Hi,

can you try this code. Basically, SCL DS contains data of Schedulling Agreements and Material Documents Data. We can differentiate the entries based on the scedulling indiacator or some thing i forgot the field name if you in RSA3 entries we can divide the entries based on this field. iwrote the code for dividing the material documents. probably it won't give that much performence. Logic is correct i checked the code. it will extract the data from EKBE Table and populates into Extractors based the Material Document entries.

*DATA DECLARATIONS

DATA: temp type i,

temp1 type i,

WA_MC02SCL LIKE C_T_DATA,

HEADER LIKE C_T_DATA,

w_bldat like ekbe-bldat,

CASE I_DATASOURCE.

WHEN '2LIS_02_SCL'.

LOOP AT C_T_DATA INTO WA_MC02SCL.

Z_HOLD_INDX = SY-TABIX.

IF WA_MC02SCL-VOHTL <> 1. “I forgot this field name(may be VOHTL….it is IN eket table i think scedule line counter).

clear temp.

select bldat from EKBE into w_bldat where EBELN = itab-EBELN And EBELP = itab-EBELP.

IF SY-SUBRC EQ 0.

if WA_MC02SCL-EBELN <> workarea-ebeln.

temp = 0.

temp1 = 1 .

WA_MC02SCL-bldat = w_bldat.

MODIFY C_T_DATA FROM WA_MC02SCL INDEX Z_HOLD_INDX.

header = wa_mc02scl.

exit.

elseif wa_mc02scl-ebelp <> header-ebelp.

temp = 0.

temp1 = 1.

Wa_mc02scl-bldau = w_bldat.

MODIFY C_T_DATA FROM WA_MC02SCL INDEX Z_HOLD_INDX.

header = wa_mc02scl.

exit.

elseif temp = temp1.

temp1 = temp + 1.

Wa_mc02scl-bldau = w_bldat.

MODIFY C_T_DATA FROM WA_MC02SCL INDEX Z_HOLD_INDX.

header = wa_mc02scl.

exit.

ENDIF.

temp = temp + 1.

endif.

endselect.

ENDIF.

ENDLOOP.

endcase.

<u><b>Please update the thread with whether it working or not?</b></u>

Any doubt's in this code please let me know i can clarify you.

all the best.

Regards,

Nagesh.

Message was edited by: Nagesh Ganisetti

Former Member
0 Kudos

Hi Nagesh,

Kindlu correct me if my assumption is wrong:

BEDAT field of DS 2LIS_02_SCL is the "Document date" field which will be filled by BLDAT field of EKBE by the extraction program( which is mapped to BW object 0DOC_DATE in the business content version)

If not could you tell ,what is the base field for 0DOC_DATE in R/3 side?

With rgds,

Anil Kumar Sharma .P

Former Member
0 Kudos

Anil,

BEDAT is purchase document created date(that is from EKKO). but i wrote code for BLDAT(we can also take from MKPF if we extract using Material Document) that Material Document Created Date.

If you can tell me some tips to improve the Performence of the code i would really appriciate that.

I'm extracting using Purchase Document i used EKBE(Purchase Document History).

Regards,

Nagesh.

Former Member
0 Kudos

The user want a report like that:

using type of Purchase Order, plant and BLDAT as input parameter,

have material, vendor, Actual goods receipt quantity and goods receipt values, from Purchase Order.

So when i enhance the DS with BLDAT, does it continue to fill the quantity field in the correct way ? ( i think the DS sum the value for PO number, position and schedule line counter)

now i'm reading your code... thanks for the help.

i'll tell you if it is ok or not.

i think that the schedule line counter field is EKET-ETENR

Message was edited by: Alex Piva

Message was edited by: Alex Piva

Former Member
0 Kudos

Can you try the above code?

Nagesh.

Answers (0)