on 09-01-2016 2:14 PM
Dear Experts,
I have a scenario Proxy to File(CSV) in SAP PI/PO 7.5
Mapping is done currently and able to get the required target structure in CSV file format which will open perfectly in excel file.
CSV file consists of multiple records ( Each record is one full report ) which is going to print as further processing. Customer want the single record should be in 36 line/rows.
For Eg:- If the report comes in 20lines, remaining lines should appear blank upto 36lines ( 36-20 = 16lines at the end of report should come blank).
End of the report i.e., 36 line consists of page no.
So next report should start from 37line as another record (append) in the same csv file.
This blank lines might vary, if the report comes more than 20, the corresponding blank lines might change. But 36lines for single report is fixed.
Target csv file screen shot attached.
Please let me know, how to achieve that empty lines after each record ( 36 lines ) in csv file.
Thanks
Raj.
Hi Raj,
You can include Footer in your receiver file structure and pass required new line characters.
Structure:
Mapping:
UDF:
Execution Type: Single Values
public String createNewLines(String count, Container container) {
StringBuilder sb = new StringBuilder();
int start = Integer.parseInt(count);
for (int i = start; i < 8; i++) {
sb.append("\n");
}
return sb.toString();
}
Output File:
I used 10 lines only instead of 36 lines, you can adjust based on your requirement.
Regards,
Praveen.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raj,
I am assuming you are using message mapping and content conversion subsequently for creating the records for each node. If so, have you used mapWithDefault for both nodes and fields to ensure that rows and columns are created even there is no data with the input.
Regards,
Sanjeev.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.