Internal table in pdf output
Hi All,
My requirement is on click of a button i need to opwn a new window and display the table output through pdf.
I am displaying a table through my bsp page using html code.
On click of a button i need to open a window and show up the table data in pdf which should be printable.
Am not using any iterator for my table. i just need transfer the internal table output to pdf and display.
Please help.
Thanks,
Sandeep.
Hi Alonso,
Am not able to get the solution for my requirement, could you please give me the detailed solution.
Can i go in this way.
What parameters should i use for otf FM
//...convert otf FM
CONCATENATE cl_abap_char_utilities=>byte_order_mark_little
l_xstring
INTO l_xstring IN BYTE MODE.
CONCATENATE 'attachment; filename=NIM2_matter_Summary_'
sy-uzeit
'.pdf'
INTO l_content.
CALL METHOD cl_bsp_utility=>download
EXPORTING
object_s = l_xstring
content_type = app_type
content_disposition = l_content
response = _m_response
navigation = _m_navigation.
Thanks in advance.
Similar Messages
-
hi friends.
Can u help me..
to convert internal table to pdf.
give me any functional module or other..
Swapnil.look at this ...
Converting internal to PDF Format
or see this ..
Issue smart form output to Email as PDF attachment
may be helpful for you -
Send internal table to pdf and then email.
hi experts.
i want to send my alv data or any other data like internal table in pdf through email.
anybody help me out plz.Hi Harris,
You got to use two FMs to achieve this.
First one to get the contents in to an internal table
Second one to send an e-mail with the content selected already.
So, better search SDN to get more info... -
Passing the Dynamic Internal Table as the Output Parameter of the FM...
Hi,
How can we pass the internal table as the output from the Function Module TABLES parameter.
SELECT * FROM TVRO BYPASSING BUFFER INTO TABLE <ltable>.
Now I need to pass the dynamic internal table <ltable> as the output in the function module.
Thanks!
Puneet.I can't use TVRO as the table type. The Table name is as the Input. This program will download the contents of the table and create an app server file. It can be for any database table.
so i want the output of this FM should be the data from that table. So what should be the TABLE type.
like in a program i will use:::
FIELD-SYMBOLS: <ltable> TYPE ANY TABLE,
<l_line> TYPE ANY,
<l_field> TYPE ANY.
SELECT * FROM (p_table) BYPASSING BUFFER INTO TABLE <ltable>.
That is my requirement. -
Dowloading Internal table into pdf formate
Hi,
I want to know how to conert an internal table into pdf file is there any fm avaliable for this .
regards,
zafartry this sample code--
tables:tsp01.
TYPE-POOLS : vrm.
DATA : vrm_val TYPE vrm_values,
wa_vrm LIKE LINE OF vrm_val,
g_name LIKE wa_vrm-text.
data: w_pdf like table of tline.
data:
print_parameters like pri_params,
valid_flag(1) type c,
w_spono type tsp01-rqident.
CLEAR wa_vrm.
wa_vrm-key = 'M'.
wa_vrm-text = 'Mango'.
APPEND wa_vrm TO vrm_val.
CLEAR wa_vrm.
wa_vrm-key = 'P'.
wa_vrm-text = 'Pineapple'.
APPEND wa_vrm TO vrm_val.
CLEAR wa_vrm.
wa_vrm-key = 'A'.
wa_vrm-text = 'apple'.
APPEND wa_vrm TO vrm_val.
call function 'GET_PRINT_PARAMETERS'
exporting
no_dialog = 'X'
user = sy-uname
importing
out_parameters = print_parameters
valid = valid_flag
exceptions
invalid_print_params = 2
others = 4.
if valid_flag = 'X' and sy-subrc = 0.
new-page print on parameters print_parameters
no dialog.
LOOP AT vrm_val into wa_vrm. " your internal table
WRITE :wa_vrm-key.
ENDLOOP.
LOOP AT vrm_val into wa_vrm.
WRITE : wa_vrm-text.
ENDLOOP.
new-page print off.
endif.
w_spono = sy-spono.
call function 'CONVERT_ABAPSPOOLJOB_2_PDF'
exporting
src_spoolid = w_spono
tables
pdf = w_pdf[]
if sy-subrc EQ 0.
endif.
call function 'GUI_DOWNLOAD'
exporting
filename = 'C:\w_pdf.pdf'
filetype = 'BIN'
tables
data_tab = w_pdf[]
if sy-subrc EQ 0.
endif.
Sumit -
Internal table in Excel output with Header and Total
Hi All,
I have a selection-screen of a report where there is option to specify the path of a file to be stored in local PC. This Report gives output in ALV format which displays header and total of columns.
Now, the requirement is, when the user specifies a path for the file in selection screen it should download in the specified location with header and total row into an excel format.
The issue is, I have the internal table with data without total and header row and the total is getting displayed in the screen through ALV feature. I am not sure, how to give the same output in downloaded excel with header row and total as it is displayed on screen.
Please let me know, if you have any suggestions.
Thanks & Regards,
Anshumita.try using TOP OF PAGE event and write the number of records in the header part.
hope this will help. -
Want the table for PDF outputs in AR
Hi all,
I want the table which stores all the prdf output paths. In general 'fnd_conc_req_outputs' table stores all the details of the path of specific concurrent request. But for my case concurrent request id is not presented in this table.
To be specific, In AR if i run the 'Statement Generation Program', am able to see the pdf output from front end when i click the 'View Ouput' button. But i want the table which stores this pdf path of Unix box, so that i can get the pdf output from Unix box and place in some other directory.
For example, if we query the fnd_conc_req_outputs table, it will give the file path as '/u01/oracle/qa2comn/admin/out/QA2_bn-orclqaapp01/NUAN_RAXINV_XML_BELGIUM_7433550_1.PDF'.
Please help in this regard as soon as possible because it very much urgent for me.
Many thanks in advance.
Thank you
KiranHi Octavio,
Most of my reports are showing path in the fnd_conc_req_outputs. But this report i am unable to see.Can you try this report once and see whether you are geting entry in that table.
To run this report
Go to Receivables User-->Print Documents-->Statements
Enter option as 'Print Statements', Bucket as 'Statement', Cycle as 'Monthly' and press submit. It autometically spawns the 'Statement Generation Program'.
But it takes some time to complete it and try in test instance only.
Thanks
Kiran -
Dynamic internal table for ALV output
Hi,
I am looking for a simple & efficient sample code for an ALV report output with dynamic columns. Can someone please help!
Thanks,
JSHere is a small example. This is pretty old code, and it uses the FM approach.
report zrich_0001.
type-pools: slis.
field-symbols: <dyn_table> type standard table,
<dyn_wa>.
data: it_alvfc type slis_t_fieldcat_alv,
wa_alvfc type slis_fieldcat_alv,
it_fldcat type lvc_t_fcat,
wa_fldcat type lvc_s_fcat.
selection-screen begin of block b1 with frame title text-001.
parameters: p_flds(5) type c.
selection-screen end of block b1.
start-of-selection.
* build the dynamic internal table
perform build_dyn_itab.
* write 5 records to the alv grid
do 5 times.
perform build_report.
enddo.
* call the alv grid.
perform call_alv.
* Build_dyn_itab
form build_dyn_itab.
* Create the dynamic internal table
data: new_table type ref to data,
new_line type ref to data.
* Create fields .
do p_flds times.
clear wa_fldcat.
wa_fldcat-fieldname = sy-index.
wa_fldcat-datatype = 'CHAR'.
wa_fldcat-intlen = 5.
append wa_fldcat to it_fldcat .
enddo.
* Create dynamic internal table and assign to FS
call method cl_alv_table_create=>create_dynamic_table
exporting
it_fieldcatalog = it_fldcat
importing
ep_table = new_table.
assign new_table->* to <dyn_table>.
* Create dynamic work area and assign to FS
create data new_line like line of <dyn_table>.
assign new_line->* to <dyn_wa>.
endform.
Have to split this code into two postings to keep formatting.
Regards,
Rich Heilman
Edited by: Rich Heilman on Jun 23, 2009 11:59 AM -
Convert internal table to pdf and send the attachment trough bcs method
Hi everyone , I try to send an pdf attachment trough bcs method but I failed. I use scms_text_to_xstring then use method cl_document_bcs=>xstring_to_solix and then add attachment with the bcs method.
Thanks in advance.
Create the attachment
CLASS cl_abap_char_utilities DEFINITION LOAD.
CONCATENATE 'PO' 'PO Line'
INTO lw_attachment SEPARATED BY
cl_abap_char_utilities=>horizontal_tab.
APPEND lw_attachment TO lt_attachment.
CLEAR lw_attachment.
LOOP AT lt_po_data_cons INTO lw_po_data_cons.
CONCATENATE lw_po_data_cons-bukrs lw_po_data_cons-ename lw_po_data_cons-usrid_long
INTO lw_attachment.
SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
CONCATENATE cl_abap_char_utilities=>newline lw_attachment
INTO lw_attachment.
APPEND lw_attachment TO lt_attachment.
ENDLOOP.
CALL FUNCTION 'SCMS_TEXT_TO_XSTRING'
EXPORTING
MIMETYPE = 'text/bin'
IMPORTING
buffer = buf2
TABLES
text_tab = lt_attachment.
l_i_attachment = cl_document_bcs=>xstring_to_solix( ip_xstring = buf2 ).
l_o_document->add_attachment(
i_attachment_type = 'PDF' " add PDF attachment
i_attachment_subject = 'PDF attachment'
i_att_content_hex = l_i_attachment
l_o_send_request->set_document( l_o_document ).
l_v_ret = l_o_send_request->send( ).Hi,
You can send the PDF using OOPS abap classes and methods
for sending it in mail .
Regards
Mansi -
Hoe to create rounded corners for the tables in PDF output
Hi,
How can I format the table corners to be rounded in XML Publisher rtf file. Can any one help me in this.
Thanks,
HC.There is no direct solution, you need to use workarounds.
Try having a shape such as a rounded rectangle on your table with clear fill and invisible table borders.
This works perfectly well for static tables.
I havent tried for for-each tables. -
Convert internal table data to pdf format and send mail to Users
Hi all ,
I want to convert the data available in internal table to pdf format and then send it to mail .
Please tell me wht are the fn modules available to convert the data from internal table to pdf and then send it mail .
regards
santosh .Hi Santosh
Sending mail with attachment report in Background
Content Author: Fernando Faian
I have read the hint about "Sending mail with attachment report".
It's great, but how can I make this function work in background??
I had that needed last year too. See attachment a function group with two functions. The second one has that functionality to send email or fax (SAP office) with attachment objects in background job using SO_ATTACHMENT_INSERT function.
Pay attention because its working with output list from spool converted to pdf.
=================================================================================
z_send_email_fax_global
FUNCTION-POOL z_gfaian_mail_fax. "MESSAGE-ID ..
WORK TABLE AREAS
TABLES: tsp01.
INTERNAL TABLES
DATA: lt_rec_tab LIKE STANDARD TABLE OF soos1 WITH HEADER LINE,
lt_note_text LIKE STANDARD TABLE OF soli WITH HEADER LINE,
lt_attachments LIKE STANDARD TABLE OF sood5 WITH HEADER LINE.
DATA: lt_objcont LIKE STANDARD TABLE OF soli WITH HEADER LINE,
lt_objhead LIKE STANDARD TABLE OF soli WITH HEADER LINE.
DATA: pdf_format LIKE STANDARD TABLE OF tline WITH HEADER LINE.
TYPES: BEGIN OF y_files,
file(60) TYPE c,
END OF y_files.
DATA: lt_files TYPE STANDARD TABLE OF y_files WITH HEADER LINE.
DATA: l_objcont LIKE soli OCCURS 0 WITH HEADER LINE.
DATA: l_objhead LIKE soli OCCURS 0 WITH HEADER LINE.
STRUCTURES
DATA: folder_id LIKE soodk,
object_id LIKE soodk,
link_folder_id LIKE soodk,
g_document LIKE sood4,
g_header_data LIKE sood2,
g_folmem_data LIKE sofm2,
g_header_data LIKE sood2,
g_receive_data LIKE soos6,
g_ref_document LIKE sood4,
g_new_parent LIKE soodk,
l_folder_id LIKE sofdk,
v_email(50).
DATA: hd_dat like sood1.
VARIABLES
DATA: client LIKE tst01-dclient,
name LIKE tst01-dname,
objtype LIKE rststype-type,
type LIKE rststype-type.
DATA: numbytes TYPE i,
arc_idx LIKE toa_dara,
pdfspoolid LIKE tsp01-rqident,
jobname LIKE tbtcjob-jobname,
jobcount LIKE tbtcjob-jobcount,
is_otf.
DATA: outbox_flag LIKE sonv-flag VALUE 'X',
store_flag LIKE sonv-flag,
delete_flag LIKE sonv-flag,
owner LIKE soud-usrnam,
on LIKE sonv-flag VALUE 'X',
sent_to_all LIKE sonv-flag,
g_authority LIKE sofa-usracc,
w_objdes LIKE sood4-objdes.
DATA: c_file LIKE rlgrap-filename,
n_spool(6) TYPE n.
DATA: cancel.
DATA: desired_type LIKE sood-objtp,
real_type LIKE sood-objtp,
attach_type LIKE sood-objtp,
otf LIKE sood-objtp VALUE 'OTF', " SAPscript Ausgabeformat
ali LIKE sood-objtp VALUE 'ALI'. " ABAP lists
CONSTANTS
CONSTANTS: ou_fol LIKE sofh-folrg VALUE 'O',
c_objtp LIKE g_document-objtp VALUE 'RAW',
c_file_ext LIKE g_document-file_ext VALUE 'TXT'.
=================================================================================
z_send_email_fax2
FUNCTION z_faian_mail_fax2.
""Interface local:
*" IMPORTING
*" REFERENCE(SRC_SPOOLID) LIKE TSP01-RQIDENT
*" REFERENCE(FAX_MAIL_NUMBER) TYPE SO_NAME
*" REFERENCE(HEADER_MAIL) TYPE SO_OBJ_DES
*" REFERENCE(OBJECT_TYPE) TYPE SO_ESCAPE
*" TABLES
*" LT_BODY_EMAIL STRUCTURE SOLI
*" EXCEPTIONS
*" ERR_NO_ABAP_SPOOLJOB
Fist part: Verify if the spool really exists
SELECT SINGLE * FROM tsp01 WHERE rqident = src_spoolid.
IF sy-subrc NE 0.
RAISE err_no_abap_spooljob. "doesn't exist
ELSE.
client = tsp01-rqclient.
name = tsp01-rqo1name.
CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
EXPORTING
authority = 'SP01'
client = client
name = name
part = 1
IMPORTING
type = type
objtype = objtype
EXCEPTIONS
fb_error = 1
fb_rsts_other = 2
no_object = 3
no_permission = 4
OTHERS = 5.
IF objtype(3) = 'OTF'.
desired_type = otf.
ELSE.
desired_type = ali.
ENDIF.
CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
EXPORTING
rqident = src_spoolid
desired_type = desired_type
IMPORTING
real_type = real_type
TABLES
buffer = l_objcont
EXCEPTIONS
no_such_job = 14
type_no_match = 94
job_contains_no_data = 54
no_permission = 21
can_not_access = 21
read_error = 54.
IF sy-subrc EQ 0.
attach_type = real_type.
ENDIF.
CALL FUNCTION 'SO_FOLDER_ROOT_ID_GET'
EXPORTING
owner = sy-uname
region = ou_fol
IMPORTING
folder_id = l_folder_id
EXCEPTIONS
OTHERS = 5.
fill out informations about the header of the email
CLEAR: g_document.
g_document-foltp = l_folder_id-foltp.
g_document-folyr = l_folder_id-folyr.
g_document-folno = l_folder_id-folno.
g_document-objtp = c_objtp.
g_document-objdes = header_mail.
g_document-file_ext = c_file_ext.
g_header_data-objdes = header_mail.
CALL FUNCTION 'SO_DOCUMENT_REPOSITORY_MANAGER'
EXPORTING
method = 'SAVE'
office_user = sy-uname
IMPORTING
authority = g_authority
TABLES
objcont = lt_body_email
attachments = lt_attachments
CHANGING
document = g_document
header_data = g_header_data
EXCEPTIONS
OTHERS = 1.
folder_id-objtp = l_folder_id-foltp.
folder_id-objyr = l_folder_id-folyr.
folder_id-objno = l_folder_id-folno.
object_id-objtp = c_objtp.
object_id-objyr = g_document-objyr.
object_id-objno = g_document-objno.
link_folder_id-objtp = l_folder_id-foltp.
link_folder_id-objyr = l_folder_id-folyr.
link_folder_id-objno = l_folder_id-folno.
REFRESH lt_rec_tab.
CLEAR lt_rec_tab.
lt_rec_tab-sel = 'X'.
lt_rec_tab-recesc = object_type. "This field for FAX/MAIL
lt_rec_tab-recnam = 'U-'.
lt_rec_tab-deliver = 'X'.
lt_rec_tab-not_deli = 'X'.
lt_rec_tab-read = 'X'.
lt_rec_tab-mailstatus = 'E'.
lt_rec_tab-adr_name = fax_mail_number.
lt_rec_tab-sortfield = fax_mail_number.
lt_rec_tab-recextnam = fax_mail_number.
lt_rec_tab-sortclass = '5'.
APPEND lt_rec_tab.
lt_rec_tab-recextnam = fax_mail_number.
lt_rec_tab-recesc = object_type.
lt_rec_tab-sndart = 'INT'.
lt_rec_tab-sndpri = 1.
APPEND lt_rec_tab.
lt_files-file = c_file.
APPEND lt_files.
begin of insertion by faianf01
hd_dat-objdes = header_mail.
CALL FUNCTION 'SO_ATTACHMENT_INSERT'
EXPORTING
object_id = object_id
attach_type = attach_type
object_hd_change = hd_dat
owner = sy-uname
TABLES
objcont = l_objcont
objhead = l_objhead
EXCEPTIONS
active_user_not_exist = 35
communication_failure = 71
object_type_not_exist = 17
operation_no_authorization = 21
owner_not_exist = 22
parameter_error = 23
substitute_not_active = 31
substitute_not_defined = 32
system_failure = 72
x_error = 1000.
IF sy-subrc > 0.
ENDIF.
end of insertion by faianf01
send email from SAPOFFICE
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
folder_id = folder_id
object_id = object_id
outbox_flag = outbox_flag
link_folder_id = link_folder_id
owner = sy-uname
check_send_authority = 'X'
TABLES
receivers = lt_rec_tab
note_text = lt_note_text
EXCEPTIONS
active_user_not_exist = 35
communication_failure = 71
component_not_available = 1
folder_no_authorization = 5
folder_not_exist = 6
forwarder_not_exist = 8
object_no_authorization = 13
object_not_exist = 14
object_not_sent = 15
operation_no_authorization = 21
owner_not_exist = 22
parameter_error = 23
substitute_not_active = 31
substitute_not_defined = 32
system_failure = 72
too_much_receivers = 73
user_not_exist = 35.
ENDIF.
ENDFUNCTION.
=================================================================================
z_send_email_fax
FUNCTION ZCBFS_SEND_MAIL.
""Interface local:
*" IMPORTING
*" REFERENCE(SRC_SPOOLID) LIKE TSP01-RQIDENT
*" REFERENCE(HEADER_MAIL) TYPE SO_OBJ_DES
*" TABLES
*" LIST_FAX_MAIL_NUMBER STRUCTURE SOLI
*" EXCEPTIONS
*" ERR_NO_ABAP_SPOOLJOB
DATA: vg_achou(1) TYPE n.
Fist part: Verify if the spool really exists
vg_achou = 1.
DO 60 TIMES.
SELECT SINGLE * FROM tsp01 WHERE rqident = src_spoolid.
IF sy-subrc IS INITIAL.
CLEAR vg_achou.
EXIT.
ELSE.
WAIT UP TO 1 SECONDS.
ENDIF.
ENDDO.
IF vg_achou = 1.
RAISE err_no_abap_spooljob. "doesn't exist
ENDIF.
client = tsp01-rqclient.
name = tsp01-rqo1name.
CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
EXPORTING
authority = 'SP01'
client = client
name = name
part = 1
IMPORTING
type = type
objtype = objtype
EXCEPTIONS
fb_error = 1
fb_rsts_other = 2
no_object = 3
no_permission = 4
OTHERS = 5.
IF objtype(3) = 'OTF'.
desired_type = otf.
ELSE.
desired_type = ali.
ENDIF.
CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
EXPORTING
rqident = src_spoolid
desired_type = desired_type
IMPORTING
real_type = real_type
TABLES
buffer = l_objcont
EXCEPTIONS
no_such_job = 14
type_no_match = 94
job_contains_no_data = 54
no_permission = 21
can_not_access = 21
read_error = 54.
IF sy-subrc EQ 0.
attach_type = real_type.
ENDIF.
CALL FUNCTION 'SO_FOLDER_ROOT_ID_GET'
EXPORTING
owner = sy-uname
region = ou_fol
IMPORTING
folder_id = l_folder_id
EXCEPTIONS
OTHERS = 5.
fill out informations about the header of the email
CLEAR: g_document.
g_document-foltp = l_folder_id-foltp.
g_document-folyr = l_folder_id-folyr.
g_document-folno = l_folder_id-folno.
g_document-objtp = c_objtp.
g_document-objdes = header_mail.
g_document-file_ext = c_file_ext.
g_header_data-objdes = header_mail.
CALL FUNCTION 'SO_DOCUMENT_REPOSITORY_MANAGER'
EXPORTING
method = 'SAVE'
office_user = sy-uname
IMPORTING
authority = g_authority
TABLES
attachments = lt_attachments
CHANGING
document = g_document
header_data = g_header_data
EXCEPTIONS
OTHERS = 1.
folder_id-objtp = l_folder_id-foltp.
folder_id-objyr = l_folder_id-folyr.
folder_id-objno = l_folder_id-folno.
object_id-objtp = c_objtp.
object_id-objyr = g_document-objyr.
object_id-objno = g_document-objno.
link_folder_id-objtp = l_folder_id-foltp.
link_folder_id-objyr = l_folder_id-folyr.
link_folder_id-objno = l_folder_id-folno.
REFRESH lt_rec_tab.
LOOP AT LIST_FAX_MAIL_NUMBER.
lt_rec_tab-recextnam = LIST_FAX_MAIL_NUMBER-LINE.
lt_rec_tab-recesc = 'U'.
lt_rec_tab-sndart = 'INT'.
lt_rec_tab-sndpri = 1.
APPEND lt_rec_tab.
ENDLOOP.
lt_files-file = c_file.
APPEND lt_files.
hd_dat-objdes = header_mail.
CALL FUNCTION 'SO_ATTACHMENT_INSERT'
EXPORTING
object_id = object_id
attach_type = attach_type
object_hd_change = hd_dat
owner = sy-uname
TABLES
objcont = l_objcont
objhead = l_objhead
EXCEPTIONS
active_user_not_exist = 35
communication_failure = 71
object_type_not_exist = 17
operation_no_authorization = 21
owner_not_exist = 22
parameter_error = 23
substitute_not_active = 31
substitute_not_defined = 32
system_failure = 72
x_error = 1000.
IF sy-subrc > 0.
ENDIF.
send email from SAPOFFICE
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
folder_id = folder_id
object_id = object_id
outbox_flag = outbox_flag
link_folder_id = link_folder_id
owner = sy-uname
TABLES
receivers = lt_rec_tab
note_text = lt_note_text
EXCEPTIONS
active_user_not_exist = 35
communication_failure = 71
component_not_available = 1
folder_no_authorization = 5
folder_not_exist = 6
forwarder_not_exist = 8
object_no_authorization = 13
object_not_exist = 14
object_not_sent = 15
operation_no_authorization = 21
owner_not_exist = 22
parameter_error = 23
substitute_not_active = 31
substitute_not_defined = 32
system_failure = 72
too_much_receivers = 73
user_not_exist = 35.
ENDFUNCTION.
Regards,
Sree -
Logic issues for manipulation of internal table data
Hi,
I am having a issue with logic of one program.
In the <b>XVBAP</b> internal table of <b>SO</b> User Exit.
We will have fields like
<b>UPDKZ, POSNR, UEPOS, ZZECD[Z-Field] etc.</b>
Above fields are related to logic.
1. Now my first point is:
<b>We need to capture Records where UPDKZ='D' and ZZECD[Z-Field] is populated.</b>
For this we will write code as below:
<b>LOOP AT XVBAP WHERE UPDKZ EQ C_D AND
ZZECD NE SPACE.
Here we will store all fields in I_XVBAP I.Table
ENDLOOP.</b>
Supoose we have retrieved records as below:
<b>VBELN, UPDKZ, POSNR, UEPOS, ZZECD
100 D 000040 000030 Text1
100 D 000050 000020 Text2
100 D 000060 000000 Text3</b>
2. My second point here is:
<b>For Every Item[POSNR] we need to get the Higher level item from UEPOS field, If the Higher level Item also has UPDKZ = D, then move the base unit and all its components into an internal table. continue this process till UEPOS for POSNR is 000000 but High item should have UPDKZ = 'D', not only this all items in this chain should have UPDKZ = 'D'.</b>
Ex:
<b>Suppose for item 000050 UEPOS is 000020 then goto XVBAP with POSNR = UEPOS[000020] and UPDKZ = 'D' if yes and then pick up UEPOS for 000020 item and continue this process till UEPOS becomes 000000 and UPDKZ = 'D'.
Here from Low level to High level all the chain items should have UPDKZ = 'D'. Then only write all items into Final Internal table.</b>
<b>Need to do this process for all above rec's [40,50,60 - POSNR].</b>
Can anybody provide me the logic for the above scenario.
Thanks in advance.
Thanks and Regards,
DeepHi Anurag,
Your assumption is wrong.
See first when we get into our logic we will get <b>XVBAP</b> data as below:
<b>VBELN, POSNR, UEPOS, UPDKZ, ZZECD
100, 10, 00, D, Text1
100, 20, 00, , Text2
100, 30, 20, D, Text3
100, 40, 30, D, Text4
100, 50, 00, , Text5
100, 60, 00, D, Text6
100, 70, 60, D, Text7</b>
After we run first point we will get data as:
Here logic is pick up data where <b>UPDKZ = D</b> and <b>ZZECD NE SPACE</b>.
<b>VBELN, POSNR, UEPOS, UPDKZ, ZZECD
100, 10, 00, D, Text1
100, 30, 20, D, Text3
100, 40, 30, D, Text4
100, 60, 00, D, Text6
100, 70, 60, D, Text7</b>
Then we will goto second point:
Here we need to look into <b>3</b> things totally in 2nd point:
1. In loop Select the record which has <b>UEPOS EQ space</b>, <b>UPDKZ = D</b> and <b>POSNR</b> should not be <b>UEPOS</b> for any other record from above data from 1st point.
<b>100, 10, 00, D, Text1</b>
will be selected into final internal table as per this point.
2. If for a POSNR value UEPOS NE SPACE, UPDKZ = D then goto UEPOS's POSNR in high level check there if UPDKZ = D and then wether UEPOS is ZERO (or) contains any value.
If any value is there repeat the process till UEPOS become ZERO. Then for that final higher level item check UPDKZ value if it has value as 'D', If has then write all those records from low item to high item into final internal table.
<b>100, 60, 00, D, Text6
100, 70, 60, D, Text7</b>
In above for Item 70[POSNR] we have UEPOS as 60 and UPDKZ as D. then we will goto UEPOS's POSNR, Now POSNR is 60 then check it's UEPOS it is ZERO so check UPDKZ because it is D write both items 60, 70 into final internal table.
2. If for a POSNR value UEPOS NE SPACE, UPDKZ = D then goto UEPOS's POSNR in high level check there if UPDKZ = D and then wether UEPOS is ZERO (or) contains any value.
If any value is there repeat the process till UEPOS become ZERO. Then for that final higher level item check UPDKZ value if it has value as 'D', If it does not have UPDKZ as 'D' then don't write any item from low to high into final internal table.
If we take the scenario of below rows:
<b>100, 20, 00, , Text2
100, 30, 20, D, Text3
100, 40, 30, D, Text4</b>
POSNR-40 has UEPOS-30 & UPDKZ = D then UEPOS's POSNR-30 has UEPOS-20 and UPDKZ-D then UEPOS POSNR-20 has UEPOS as 00 then stop here and see UPDKZ which is ZERO so don't consider items 20,30,40 into final i.table.
In the above chain in any record UPDKZ is not 'D' then skip the process anddon't write the records into final internal table.
Final output will come as:
<b>100, 10, 00, D, Text1</b>
<b>100, 60, 00, D, Text6
100, 70, 60, D, Text7</b>
Thanks for all your efforts.
Thanks,
Deep -
How Internal table data send to sap mail as a attachment?
Hi,
Can any one please let me know , how we will send internal table data to sap mail.
In my internal table my data output length is more than 255 characters.
Thanks in advance.Hi
Try out the below code:
DATA: ld_mtitle LIKE sodocchgi1-obj_descr,
ld_format TYPE so_obj_tp ,
ld_attdescription TYPE so_obj_nam ,
ld_attfilename TYPE so_obj_des .
* ld_receiver LIKE sy-subrc.
DATA: it_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
it_attachment LIKE solisti1 OCCURS 0 WITH HEADER LINE,
it_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
w_cnt TYPE i,
w_sent_all(1) TYPE c, "#EC NEEDED
w_doc_data LIKE sodocchgi1.
REFRESH it_receivers . CLEAR it_receivers .
IF v_trip_send = 'X'.
it_receivers-receiver = it_trip_dload-approver_email .
ELSE .
it_receivers-receiver = it_adv_dload-approver_email .
ENDIF.
it_receivers-rec_type = c_u .
APPEND it_receivers. CLEAR it_receivers.
* it_receivers-receiver = ' <Email ID> ' "Email address.
IF v_trip_send = 'X' .
it_receivers-receiver = it_trip_dload-requester_email .
ELSE .
it_receivers-receiver = it_adv_dload-requester_email .
ENDIF .
it_receivers-rec_type = c_u .
it_receivers-copy = 'X' .
APPEND it_receivers. CLEAR it_receivers.
ld_mtitle = p_mtitle.
ld_format = p_format.
ld_attdescription = p_attdescription.
ld_attfilename = p_filename.
* Fill the document data.
w_doc_data-doc_size = 1.
* Populate the subject/generic message attributes
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = c_saprpt.
w_doc_data-obj_descr = ld_mtitle .
w_doc_data-sensitivty = 'F'.
* Fill the document data and get size of attachment
CLEAR w_doc_data.
READ TABLE it_attach INDEX w_cnt.
w_doc_data-doc_size =
( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = c_saprpt.
w_doc_data-obj_descr = ld_mtitle.
w_doc_data-sensitivty = c_f.
CLEAR it_attachment.
REFRESH it_attachment.
it_attachment[] = it_attach[].
* Describe the body of the message
CLEAR it_packing_list.
REFRESH it_packing_list.
it_packing_list-transf_bin = space.
it_packing_list-head_start = 1.
it_packing_list-head_num = 0.
it_packing_list-body_start = 1.
DESCRIBE TABLE it_message LINES it_packing_list-body_num.
it_packing_list-doc_type = c_raw.
APPEND it_packing_list.
* Create attachment notification
it_packing_list-transf_bin = c_x.
it_packing_list-head_start = 1.
it_packing_list-head_num = 1.
it_packing_list-body_start = 1.
DESCRIBE TABLE it_attachment LINES it_packing_list-body_num.
it_packing_list-doc_type = ld_format.
it_packing_list-obj_descr = ld_attdescription.
it_packing_list-obj_name = ld_attfilename.
it_packing_list-doc_size = it_packing_list-body_num * 255.
APPEND it_packing_list.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = w_doc_data
put_in_outbox = c_x
commit_work = c_x
IMPORTING
sent_to_all = w_sent_all
TABLES
packing_list = it_packing_list
contents_bin = it_attachment
contents_txt = it_message
receivers = it_receivers.
&*********<removed_by_moderator_together_with_6_unmentionables>************&
Edited by: Julius Bussche on Jun 23, 2008 11:04 PM -
Reg:doubt in dynamic generated internal table
hi everyone,
i generated a internal table dynamically,the output is in fied symbol,i want to create a internal table using the field symbol sturture,how to create that????
plz tell me how to create a internal table referencing field symbol structure........
very urgent plz help.........
thanks in advance....
regards,
balaji.sHi ,
check out a small part of an alv report which is using dynamic internal table
data: dy_table type ref to data,
dy_line type ref to data.
field-symbols: <dyn_table> type standard table,
<dyn_wa> type any,
<dyn_line> type any.
call method cl_alv_table_create=>create_dynamic_table
exporting
it_fieldcatalog = ifc
importing
ep_table = dy_table.
assign dy_table->* to <dyn_table>.
CREATE A DYNAMIC WORK AREA.
create data dy_line like line of <dyn_table>.
sort it_mard by matnr werks.
loop at it_mard into wa_mard.
at new matnr.
assign dy_line->* to <dyn_wa>.
assign component 'MATNR' of structure <dyn_wa> to <dyn_line>.
<dyn_line> = wa_mard-matnr.
read table it_mard2 into wa_mard1 with key matnr = wa_mard-matnr.
v_amount = wa_mard1-v_total * p_unit.
call function 'SPELL_AMOUNT'
exporting
amount = v_amount
currency = 'INR'
FILLER = ' '
language = sy-langu
importing
in_words = v_price
exceptions
not_found = 1
too_large = 2
others = 3
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
assign component 'V_TOTAL' of structure <dyn_wa> to <dyn_line>.
<dyn_line> = wa_mard1-v_total.
assign component 'V_PRICE' of structure <dyn_wa> to <dyn_line>.
<dyn_line> = v_price-word.
endat.
concatenate 'STOCK' '-' 'IN' '-' wa_mard-werks into v_new.
assign component v_new of structure <dyn_wa> to <dyn_line>.
<dyn_line> = wa_mard-labst.
at end of matnr.
append <dyn_wa> to <dyn_table>.
clear wa_mard.
clear <dyn_wa>.
unassign <dyn_line>.
unassign <dyn_wa>.
endat.
endloop.
rewards points if helpful. -
Need ALV LIST for displaying Dynamic Internal Tables
Hi Guys,
I have some thing like 2 Dynamic internal tables.
Say 1st Internal table will be filled based on some condition.
say 2nd table will be filled based on some condition.
When appending the 1st Internal table, if that internal table is filled it creates another internal table of same kind and continues so on until some condition.
In the same way when appending the 2nd Internal table, if that internal table is filled it creates another internal table of same kind and continues so on until some condition.
My requirement is I need to display all these Internal tables in the output.
The output should look something like
1st Internal Table
some gap
2nd Internal Table
some gap
so on...................
Is there any standard ALV List, to display all these Internal Tables in such a way.
Thanks,
Prasad.Hi.
One thing more here is code which get 10 records from 2 tables and then show them in ALV.
first when u execute it will show data from ist table.
when u go back (F3) then it will sow data from 2nd table.
But if u want to show both ALV on the same screen then u will have to use screen programin and using class u will have to create container and then have to do it.
But as i above mentioned. that sample code is as below.
REPORT ztn_test LINE-COUNT 100.
data: itab_ref type ref to data.
data: hstr type lvc_title.
data: tabname like DD02T-TABNAME.
tabname = 'MARA'. " First Table
create data itab_ref type standard table of (tabname).
field-symbols: <itab> type standard table.
assign itab_ref->* to <itab>.
select * UP TO 10 ROWS from (tabname) into corresponding fields of table <itab>.
perform showalv.
tabname = 'KNA1'. " 2nd Table
create data itab_ref type standard table of (tabname).
"field-symbols: <itab> type standard table.
assign itab_ref->* to <itab>.
select * UP TO 10 ROWS from (tabname) into corresponding fields of table <itab>.
perform showalv.
form showalv.
" to show that data in alv
type-pools: slis.
data: myalv type ref to cl_gui_alv_grid, "ALV Grid
fieldcat type slis_t_fieldcat_alv, "Field Catalog Table
ls_fcat type slis_fieldcat_alv, "Line of Field catalog.
ls_heading type slis_listheader, "Line of Heading.
layout type slis_layout_alv, "layout of ALV for Heading and Logo.
event type slis_t_event, "Event Raising to Display Heading.
event_str type slis_alv_event. "Event String.
type-pools: slis.
data: heading type slis_t_listheader. "List Heading.
if heading[] is initial.
ls_heading-typ = 'H'.
ls_heading-info = 'HR: Master Data Change History'.
append ls_heading to heading.
endif.
* ls_heading-typ = 'A'.
* ls_heading-info = ''.
* APPEND ls_heading TO heading.
* ALV DISPLAY *
*******Making Layout of ALV
layout-zebra = 'X'.
layout-colwidth_optimize = 'X'.
*Calling function to raise event to display heading and icon above ALV
call function 'REUSE_ALV_EVENTS_GET'
exporting
i_list_type = 0
importing
et_events = event[]
* EXCEPTIONS
* LIST_TYPE_WRONG = 1
* OTHERS = 2
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
******calling TOP_OF_PAGE Event
read table event with key name = 'TOP_OF_PAGE' into event_str.
if sy-subrc = 0.
move: 'TOP_OF_PAGE' to event_str-form.
modify event from event_str index sy-tabix.
endif.
**** Now use this Fuction to display ALV without any Screen Programming.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
i_callback_program = 'SAPLZFSL_HR_UTILS' "sy-cprog
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
* I_CALLBACK_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
i_structure_name = tabname
* I_BACKGROUND_ID = ' '
i_grid_title = hstr "Heading of ALV Grid.
* I_GRID_SETTINGS =
is_layout = layout
* it_fieldcat = fieldcat[]
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
* IT_SORT =
* IT_FILTER =
* IS_SEL_HIDE =
i_default = 'X'
i_save = 'X'
* IS_VARIANT =
it_events = event[]
* IT_EVENT_EXIT =
* IS_PRINT =
* IS_REPREP_ID =
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* I_HTML_HEIGHT_TOP = 0
* I_HTML_HEIGHT_END = 0
* IT_ALV_GRAPHICS =
* IT_HYPERLINK =
* IT_ADD_FIELDCAT =
* IT_EXCEPT_QINFO =
* IR_SALV_FULLSCREEN_ADAPTER =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
tables
t_outtab = <itab>
* EXCEPTIONS
* PROGRAM_ERROR = 1
* OTHERS = 2
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
endform.
Maybe you are looking for
-
How to get rid of StackOverflowError in recursion!!
Hello everyone, I am getting the StackOverflowError in my program when I do recursion. One of my function calculates the regions in an Image using the 8-based connectivity principles. I tried it on small example image grids of size less than 47 and i
-
How can I get the SUBMIT button to function as I want it to using Acrobat X? I want to use a SUBMIT button to return the completed form to a different email address than my own. I entered a button on the form, I entered the email address correctl
-
IS Retail and Real Estate in a single instance possible ?
Dear Experts, Presently we are running Wholesale and Retail business in the same production system- ECC6.0 EHP4 In forthcoming we are planing to bring IS Retail Real Estate also in the same system.. In this scenario i have some doubts Please help me
-
GI Actual Cost-Material Component
Hello Experts, I have maintained movement type 101 for GR, 281 for GI for valuated project stock and Item Category L for creating material component. Actually, my report reflects the planned figures on WBS, then breaks on activity then reflects furth
-
Assign message number 161 to message class F2
Hi all, Whats tcode to assign message no 161-Vendor & already exists to message class F2-Master Data Maintenance: Customer, Vendor in? Then I will set as Error or Warning at tcode OBA5. Really appreciate your help Thanks