2009 Mar 21 9:40 AM
Hi Experts,
I am sending few data in through excel(in attachment) using fm SO_NEW_DOCUMENT_ATT_SEND_API1.
I wanted to dispaly the data line by line in excel sheet. I properly populated the data in parameter 'contents_bin' i.e. appended the data line by line. But the problem is that when the FM execute I got the excel sheet but all the data is displayed in only one line.
Can anybody suggest me how I can resolve the issue?
Thanks,
Neha
2009 Mar 21 9:50 AM
Hi,
You need to insert the Horizontal tab inbetween the Fields..check the below code.
LOOP AT p_emp_details INTO i_emp_details_line.
CONCATENATE i_emp_details_line-pnalt
i_emp_details_line-egroup
i_emp_details_line-ename
i_emp_details_line-stext
i_emp_details_line-srvdt
i_emp_details_line-ltext
i_emp_details_line-pbtxt
i_emp_details_line-btrtx
i_emp_details_line-mndat
i_emp_details_line-fsdate
i_emp_details_line-frdate
i_emp_details_line-egroup
i_emp_details_line-ptext
i_emp_details_line-ftext
INTO l_string
SEPARATED BY cl_abap_char_utilities=>horizontal_tab. --> Tab
APPEND l_string TO lt_objbin.
CLEAR l_string.
ENDLOOP.
Hi Experts,
I am sending few data in through excel(in attachment) using fm SO_NEW_DOCUMENT_ATT_SEND_API1.
I wanted to dispaly the data line by line in excel sheet. I properly populated the data in parameter 'contents_bin' i.e. appended the data line by line. But the problem is that when the FM execute I got the excel sheet but all the data is displayed in only one line.
Can anybody suggest me how I can resolve the issue?
Thanks,
Neha
2009 Mar 21 9:50 AM
Hi,
You need to insert the Horizontal tab inbetween the Fields..check the below code.
LOOP AT p_emp_details INTO i_emp_details_line.
CONCATENATE i_emp_details_line-pnalt
i_emp_details_line-egroup
i_emp_details_line-ename
i_emp_details_line-stext
i_emp_details_line-srvdt
i_emp_details_line-ltext
i_emp_details_line-pbtxt
i_emp_details_line-btrtx
i_emp_details_line-mndat
i_emp_details_line-fsdate
i_emp_details_line-frdate
i_emp_details_line-egroup
i_emp_details_line-ptext
i_emp_details_line-ftext
INTO l_string
SEPARATED BY cl_abap_char_utilities=>horizontal_tab. --> Tab
APPEND l_string TO lt_objbin.
CLEAR l_string.
ENDLOOP.
2009 Mar 21 11:26 AM
horizontal tab will only separate the fields, for new line u need to give a return also.
like this
data: c_ret type c value cl_abap_char_utilities=>cr_lf,
c_tab type c value cl_abap_char_utilities=>horizontal_tab.
concatenate wa_it_orders-plnum wa_it_orders-matnr wa_it_orders-plwrk into wa_objbin separated by c_tab.
concatenate c_ret wa_objbin into wa_objbin.
append wa_objbin to it_objbin.
Edited by: kartik tarla on Mar 21, 2009 4:56 PM
2009 Mar 21 1:44 PM
Hi
CLASS CL_ABAP_CHAR_UTILITIES DEFINITION LOAD.
CONSTANTS:
CON_TAB TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB,
CON_CRET TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF.
LOOP AT T_FINAL INTO WA_T_FINAL.
CONCATENATE WA_T_FINAL-PERNR
WA_T_FINAL-NAME
WA_T_FINAL-LEVEL
WA_T_FINAL-POS
WA_T_FINAL-JOB
WA_T_FINAL-SECTION
WA_T_FINAL-DEPT
WA_T_FINAL-GROUP
WA_T_FINAL-EX_HEAD
WA_T_FINAL-SUPID
WA_T_FINAL-SUPNM
WA_T_FINAL-FHRNM
WA_T_FINAL-VACID
WA_T_FINAL-VAC_SECTION
WA_T_FINAL-VAC_DEPT
WA_T_FINAL-VAC_GROUP
WA_T_FINAL-VAC_EX_HEAD
WA_T_FINAL-VAC_FHRNM
INTO T_FINAL1 SEPARATED BY CON_TAB.
CONCATENATE CON_CRET T_FINAL1 INTO T_FINAL1.
APPEND T_FINAL1.
ENDLOOP.
2009 Mar 21 4:07 PM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |