Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Supress Column Heading - File Content Conversion in Sender Adapter

Hi,

Let me give a more clear picture about my scenario. I need to convert CSV File to XML output:-

My source file has column heading and values. The sample data is mentioned hereunder:-

PERNR;KID;PNALT;NACHN;NAME2;VORNA

;1200;1200;Angus

I have created a data type as under:-

DT_LegacyEmployee (Category - Complex Type)

Employees (Category - Element, Occurence - 1)

Header (Category - Element, Occurence - 0...1)

PERNR_H

KID_H

PNALT_H

NACHN_H

NAME2_H

VORNA_H

Employee (Categroy - Element, Type - DT_LegacyEmployee_Row, Occurence - 0...unbounded)

PERNR

KID

PNALT

NACHN

NAME2

VORNA

The file conversion parameters in the file sender adapter are mentioned hereunder:-

Document Name - MT_LegacyEmployee

Document Namespace - http://abc.com/xi

Recordset Name - Employees

Rescordset Structure - Header,1,Employee,*

Recordsets per Message - 1

Key Field Type - String (Case Sensitive)

Employee.fieldSeparator - ;

Employee.endSeparator - 'nl'

Employee.fieldNames - PERNR,KID,PNALT,NACHN,NAME2,VORNA

I dont' have a key field value. How do we remove the header and show only the values in the xml output. I have searched the forum topics as well checked many blogs related to file content conversion, but nothing helped. Kindly advice how to fix this issue. Thanks in advance.

Regards.

Praveen

Former Member replied

Hi Praveen,

Change your File Adapter as below

Document Name - MT_LegacyEmployee

Document Namespace - http://abc.com/xi

Recordset Name - Employees

Rescordset Structure - Employee,*

Recordsets per Message - 1

Key Field Type - String (Case Sensitive)

Employee.fieldSeparator - ;

Employee.endSeparator - 'nl'

Employee.fieldNames - PERNR,KID,PNALT,NACHN,NAME2,VORNA

There is no need for the Header required in the data type.

DT_LegacyEmployee (Category - Complex Type)

Employees (Category - Element, Occurence - 1)

Employee (Categroy - Element, Type - DT_LegacyEmployee_Row, Occurence - 0...unbounded)

PERNR

KID

PNALT

NACHN

NAME2

VORNA

Now the trick is in the mapping program

Lets assume your mapping looks like

MT_LegacyEmployee ---> MT_TargetEmployee

- Employees ---> Records

- Employee ---> Record

- PERNR ---> TargetPERNR

- .. so on

When you do a mapping from Employee ---> Record apply the following logic.

(PERNR)--->
             (TestEquals =) --->(NOT)--->
(Constant) --->                                (IF)
(PERNR) 				  (IF Without Else) ---> (Record)
                                               (THEN)
                            (Employee)--->

When doing this make sure RightClick on PERNR and Select Context ---> Employees.

By default context would be from Employee and it will give you an error of XSD format. So make sure you are changing the context.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question