Create Unicode file for SAP Bapi RFM

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
swades
Premium Member
Premium Member
Posts: 323
Joined: Mon Dec 04, 2006 11:52 pm

Create Unicode file for SAP Bapi RFM

Post by swades »

Hello,
I have created a DataStage job to extract data from SAP R/3 using Functional Module (RFM) for that I have used SAP BAPI stage. Functional Module has import parameters to pass. As per the SAP Stage guide line, I can pass parameters from input file (Path of the file specified within the stage).
File has to be Unicode file (Because we have SAP system Unicode and DataStage too). for now, I have created flat file in Windows (using notepad and saved as Unicode) and put it Unix and it is working fine. i.e. I am getting data as expected.
But actual requirement is I should be able to pass parameters during run time to extract data. so My idea is to create required file using those run time parameters and use that file for BAPI stage. but now, question is that file has to be Unicode.
So My question is. How can I created Unicode file in DataStage?
Our DataStage Environment is NLS enabled. I have tried with to create file with UTF-8 as NLS map but it not working.

Or any other idea to pass required parameters to BAPI Stage?

Thanks
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

In your output sequential file stage, go to the Stage -> NLS Map tab and enter your file's map.
swades
Premium Member
Premium Member
Posts: 323
Joined: Mon Dec 04, 2006 11:52 pm

Post by swades »

I have created file with UTF-8 but that file is not being recognized by BAPI Stage.
It says:
No byte order mark found. Expecting input file to be in system byte order.
and it is not passing parameter properly and not returning data. -- Job is success full though.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

What sort of a machine is your SAP installed on - could it have a different byte ordering from your DataStage server machine?
swades
Premium Member
Premium Member
Posts: 323
Joined: Mon Dec 04, 2006 11:52 pm

Post by swades »

I have checked on both LANG on both the server by command: env | grep LANG
It is UTF-8

But I wandered is. it is working with the file I created from Windows (and saved as Unicode) and dropped on Unix. so how can we create same file using DataStage?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Looks like Arnd might be on to something with his question about opposite-Endian. How did you "drop" the file on UNIX?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
mhester
Participant
Posts: 622
Joined: Tue Mar 04, 2003 5:26 am
Location: Phoenix, AZ
Contact:

Post by mhester »

BOM or Byte Order Mark will be added by default when using Notepad and writing UTF-8. No such behavior is present with Unix since files in Unix can be multi purpose and the BOM may interfere with processing correctness.

The BOM is usually at the beginning of the stream to let the receiving appliation know the "endianness" of the data. UTF-8 does not really require it as well as UTF-32.

So if you moved the file from Windoze as binary I would think that the BOM should have been preserved.

If you did move as binary then I might suggest creating the file as UTF-16.

Let us know
Post Reply