cancel
Showing results for 
Search instead for 
Did you mean: 

File generation through APD

anil_babu13
Participant
0 Kudos

Hi Experts,

I am generating a .txt file to my client work station from a DSO through APD daily. I need to put few more fields in the file with constant values while generation. My doubts is in this case, we need to write any abap programme for this or any other solutions are there?

Thanks in advance.

Anil

Accepted Solutions (1)

Accepted Solutions (1)

ccc_ccc
Active Contributor
0 Kudos

Hi Anil,

Just do as like below.

  1. Add "ABAP Routine" transformation between DSO and Flatfile.
  2. In Source Flds Tab -- Add All fields from Field List to Source Flds
  3. In Target Flds Tab -- Add extra fields which ever you want
  4. In Routine Tab -- Write logic as like below.

DATA: LS_SOURCE TYPE Y_SOURCE_FIELDS,

       LS_TARGET TYPE Y_TARGET_FIELDS.


LOOP AT IT_SOURCE INTO LS_SOURCE.


  LS_TARGET-field1 =  LS_SOURCE-field1.

LS_TARGET-field2 =  LS_SOURCE-field2.

LS_TARGET-field3 =  LS_SOURCE-field3.


LS_TARGET-field4 = "Value1" "Constant

LS_TARGET-field5 = "Value2" "Constant



ENDLOOP.


Hope it will some idea.


Thank you,

Nanda


anil_babu13
Participant
0 Kudos

Hi Nanda,

Thx for the inputs and it is working.

I am using APD to generate a file from DSO on daily basis. Now, i want to split the DSO records in to 2 parts and want to generate 2 files instead of 1 file.

I tried to map DSO to filters parallel, but it is not working. any ideas to how to achieve this like we have to use any transormation type or anything?

Thanks

ccc_ccc
Active Contributor
0 Kudos

Hi Anil,

Happy to hear that provided logic works for you. Please close thread by selecting "Correct answer" and open new thread for splitting two flat file issue.

If your query resolved , please assign full points.

Thank you,

Nanda

ccc_ccc
Active Contributor
0 Kudos

Please let me know your exact requirement with sample data in new thread.

Thank you,

Nanda

Answers (2)

Answers (2)

former_member184494
Active Contributor
0 Kudos

What is the source of the APD ..? if it is a query - then add additional key figures with formulae in them to get the constants - and then if you need some specific text in those columns - modify it using ABAP in the APD.

former_member186053
Active Contributor
0 Kudos

Hi Anil,

I think you can write a piece of code in Routine in transformation , try with help of abaper.

Regards,

Vengal.