We have added search box. Key in SAP issue keyword to search
TopBottom

Announcement: wanna exchange links? contact me at sapchatroom@gmail.com.

RE: [sap-abap] ABAP Code for Multiple Fields to Single InfoObject

Posted by Admin at
Share this post:
Ma.gnolia DiggIt! Del.icio.us Yahoo Furl Technorati Reddit

Reply from ogonzalez on Oct 10 at 1:59 PM
In line nothing to do...it has reference Part2
Hope this help you,
Best Regards
Oscar

---------------Original Message---------------
From: Imran Shafiq
Sent: Friday, October 10, 2014 3:08 AM
Subject: ABAP Code for Multiple Fields to Single InfoObject

Hi

In CSV file there are Spare Part Name and its Unit Cost repeat 10 times i.e. 20fields like Part1&Cost1,Part2&Cost2................... Part10&Cost10
90% Part1&Cost1 to Part5&UCost5 fields are filled it means Part6&Cost6 to Part10&Cost10 are empty.
in other words
10% Part1&Cost1 to Part10&Cost10 fields are filled.
And ZSPR_PART and ZUNIT_CST are the single info objects for Part1 -10 and Cost1 -10

So I map the Part1 to ZSPR_PART and Cost1 to ZUNIT_CST in transformation only.
And Write Start Routine as:

LOOP AT SOURCE_PACKAGE ASSIGNING <source_fields>.
IF <source_fields>-Part1 is NOT INITIAL AND <source_fields>-Cost1 IS NOT INITIAL .
*Nothing to do
ELSEIF <source_fields>-Part2 is NOT INITIAL AND <source_fields>-Cost2 IS NOT INITIAL .
<source_fields>-Part1 = <source_fields>-Part2.
<source_fields>-Cost1 = <source_fields>-Cost2.
ELSEIF <source_fields>-Part3 is NOT INITIAL AND <source_fields>-Cost3 IS NOT INITIAL .
<source_fields>-Part1 = <source_fields>-Part3.
<source_fields>-Cost1 = <source_fields>-Cost3.
...................................................

...................................................
ELSEIF <source_fields>-Part10 is NOT INITIAL AND <source_fields>-Cost10 IS NOT INITIAL .
<source_fields>-Part1 = <source_fields>-Part10.
<source_fields>-Cost1 = <source_fields>-Cost10.
ENDIF.
ENDLOOP.

But it shows the following error:
The data object "<SOURCE_FIELDS>" has no component called "Part2", but there is a component called "Part1".

How to resolve this issue?

 
Reply to this email to post your response.
 
__.____._
Manage Settings | Unsubscribe | Create FAQ | Send Feedback
  
Copyright © 2014 Ziff Davis, LLC. and message author.
Ziff Davis, LLC. 28 E 28th Street New York, NY 10016
ogonzalez  
 
Mark as helpful
View this online
Ask a new question
 
In the Spotlight
Earn Recognition for Your Contributions at Toolbox for IT. Gain Points for Community Achievements

_.____.__

0 comments:

Post a Comment

T r a n s l a t e to your language