Hi,
My requirement is that I will get a flat file in which one of the fields will be with 26 digits... I am using transaction KS01... So for the cost center creation the criteria is that I need to concatenate the company code, the 7-11 digits (of the 26 digit field) & zero '0'... I am able to do this for the first record ... but I am not able to get the same for the second record... the logic that i have written is as follows:-
in the field mapping step under the cost center I written the following ABAP code.
DATA : V_BUKRS LIKE CSKS-BUKRS.
SELECT BUKRS
INTO V_BUKRS
FROM CSKS
WHERE KOKRS = SOURCE-CONTROLLING_AREA.
CONCATENATE V_BUKRS
SOURCE-26DIGIT_CTCTR+6(5)
'0'
INTO TARGET-KOSTL.
ENDSELECT.
How do I debug this program in LSMW??
Your help is appreciated.
-Seema.
Double click on "convert data" in your LSMW.
This will take you to your conversion program.
Click system, status. See your program name, double click it. Now look for your code, set a breakpoint. Come back out to your conversion program selection screen and click execute.
Also, it might be better if your select was more like this.
DATA : V_BUKRS LIKE CSKS-BUKRS. clear v_bukrs. SELECT Single BUKRS INTO V_BUKRS FROM CSKS WHERE KOKRS = SOURCE-CONTROLLING_AREA. if sy-subrc = 0. CONCATENATE V_BUKRS SOURCE-26DIGIT_CTCTR+6(5) '0' INTO TARGET-KOSTL. endif.
Regards,
Rich Heilman
Message was edited by: Rich Heilman
Hi Seema,
When you are in the initial screen of LSMW for the object(with all the radio-buttons), click on the 'Personal Menu' push button and select the checkbox for 'Display Conversion Program.'. Then you can simply select that action and put a break-point in the code section and debug it.
But if I may comment, just based on the code piece given here, your 'SELECT statement may not be returning any records for your second record.
Is your SOURCE-CONTROLLING_AREA field similar to CSKS-KOKRS? Otherwise a select like this might not return any values.
Also, there is a potential for multiple records to be fetched from CSKS since you are passing only partial key. So, essentially you are moving your concatenated value into the TARGET-KOSTL based on your last record from that select.
What is your requirement with regards to the BUKRS? Is it that you need to create cost centers for all BUKRS assigned to a given controlling area on the file?
Please let us know.
Srinivas
Hi Seema,
your select of csks seems to be strange.
what's your relation between controlling aerea (Kokrs)
and company (bukrs) is it 1:1 or is it 1:n ?
if it's 1:1 you've to select TKA02
if it's 1 kokrs : n Bukrs you can't find out the correct company - you need more information in your flat file !
regards Andreas
Add a comment