Smartforms: no page break between last line item and footer in table?
Hello All,
my smartform has FIRST and NEXT pages. I would like to avoid a page break between last item line of a table in MAIN window and the footer of the same table.
Here is how it looks currently.
Output of FIRST page, MAIN window, table ITEMS:
1.line item
2.line item
3.line item
4.line item
page break
output of NEXT page, MAIN window, table ITEMS:
1.footer line
2.footer line
I would like that if a footer does not fit on FIRST page, it would be displayed on NEXT page with last item line.
It should be like this:
output of FIRST page, MAIN window, table ITEMS
1.line item
2.line item
3.line item
page break
output of NEXT page, MAIN window, table ITEMS
4.line item
1.footer line
2.footer line
Any ideas?
Thanks and best regards,
Mindaugas
Do you mean line item text or your want to print footer text?
If your trying yo display some footer text, then you either place a footer window or you can create a table inside your main window and place text under the footer of the table, then it will display the text without any page break.
If it is item tem.
Then you need to build additional logic. As we cannot guess, the total number of item text upfront.
Example: if page1 can hold 15 line items, check whether your header and item can fit in page one else call a new page by placing a condition FLAG = "X".
I hope it will help you to solve your problem.
Regards,
SaiRam
Similar Messages
-
Strike Through between last line Item and footer
Hi Experts,
I have a requirement like this,
I have dynamic table which displays items of invoice and Footer in the Master page.
There will be dynamic space between Table and Footer when the lines items are not completely filled till the footer area. My requirement is to draw a cross line which begins at the end of the line( left most corner) and ends above the footer(right most corner)
As if the diagonal line is drawn.
Please let me know how to achieve the above functionality.
Regards,
NarayanDo you mean line item text or your want to print footer text?
If your trying yo display some footer text, then you either place a footer window or you can create a table inside your main window and place text under the footer of the table, then it will display the text without any page break.
If it is item tem.
Then you need to build additional logic. As we cannot guess, the total number of item text upfront.
Example: if page1 can hold 15 line items, check whether your header and item can fit in page one else call a new page by placing a condition FLAG = "X".
I hope it will help you to solve your problem.
Regards,
SaiRam -
SD report :correlation between SD line item and its FI line item
Hi,
We are developing a SD report where we are not able to correlate between FI line item with SD line item.As SD line item have differernt division so how to identify which line item of FI belongs to which SD line item?Hi,
You can map that by document flow table: VBFA.
There you can see the correlation of all docs related in a sales process.
Regards,
Demétrius -
:correlation between SD line item and its FI line item
Hi,
We are developing a SD report where we are not able to correlate between FI line item with SD line item.As SD line item have differernt division so how to identify which line item of FI belongs to which SD line item?Hello Satya ,
i donu2019t think u can map FI <-> SD line Items , as per my knowledge ,while create FI entry system will do consolidation based on the materials , so in such cases u wont get required data.
regards
Prabhu -
Relation between Invoice Line items and Accounting Line item
Dear All,
My requirement is to print all the invoice documents and it's tax values like cenvat, Ecess, BED and VAT.
I have to fetch these tax details from BSEG table .
I' am getting Invoice number ( RBKP-BELNR ) from BKPF-AWTKEY .
Can any one please tell me how to relate the Invoice line items and Accounting document line items..
Any BAPI or FM is there to retrieve these data.
Please do needful in this regard.Hi,
from table bseg - field Koart
K = Vendor
D = Customer
S = G/L account here tax lines identify with buzid = T
or take table bset for taxes
Andreas -
What is the direct link between Schedule Line item and Delivery line item?
Hi SAP SD Gurus,
The question is simple. I would like to calculate the Open order quantity for a particular month based on the Schedule Line Date.
I am taking all the Schedule lines falling below the running date of the month and sum up that and look for the deliveries happened for that Schedule lines.
I am unable to link that Schedule line with that Delivery line item.
The only link is Schedule Line Number in VBEP table which is not available in LIPS. I would like sum up the Schdule line Quantities and Subtract the sum of the Delivery quantities which will give me the Open orders for the particular day of the month.
Can anyone help me to link this VBEP table to LIPS table to connect the Schedule line number with the Delivery line item?
Thanks in advance for your help..
AugustineAnuj,
I am aware of the Functional Modules.
I wanted to know for this Schedule Line, this is Delivery document created.
Where in SAP through Tables it is linked? Because, I need to source the Tables to calulate the open orders by way of external report through Business Object.
The table link from VBEP to LIPS is not directly linked. It is linked from Sales order line item level. Because we are capturing all the Sales order Line tiems through the Delivery Status which is not equalled to C. But if there are partial deliveries against the Scheuld Line item level, we need to identify. The only common joint should be Scheldule line number which is not available in LIPS.
If we are developing report inside SAP, we can use the said Functional Modules to capture through Structures VBEPD. Since it is a external reporting , we need to give correct tables and the joints. Hence I am looking for any other way to solve this.
Thanks
Augustine Ponraj -
Link between delivery line item and sales order item schedule line.
Hello friends,
This is a continuation of my earlier query - for which I got half the solution, and this is the remaining problem.
I want to know: from delivery document line item, how to link it to sales order line item's schedule line (when there are multiple schedule lines with identical quantities).
Thanks for your help.
- ChetanThis is the code which i used for the same purpose and its working.
Hope this will help you too....
****it_itab is my final internal table.
*Internal table for manupulating the Delivery balance when
*its used in more than one schedule line
TYPES: BEGIN OF ty_new,
vbeln TYPE vbep-vbeln," so no
posnr TYPE vbep-posnr," so line no
etenr TYPE vbep-etenr," schedule line
delno TYPE lips-vbeln,"delivery no
delposnr TYPE lips-posnr,"del item no
totval TYPE vbep-wmeng," total del wise value
val TYPE vbep-wmeng," del wise used value
sdval TYPE vbep-wmeng,"schedule wise del used value
sdtotval TYPE vbep-wmeng," total Schedule value
END OF ty_new.
DATA:it_new TYPE ty_new OCCURS 0,
wa_new TYPE ty_new.
DATA: it_vbepvb TYPE TABLE OF vbepvb,
wa_vbepvb LIKE LINE OF it_vbepvb,
fvbfa TYPE TABLE OF vbfa,
fvbup TYPE TABLE OF vbup,
fvbap TYPE TABLE OF vbapvb.
LOOP AT it_vbak INTO wa_vbak.
LOOP AT it_vbap INTO wa_vbap
WHERE vbeln = wa_vbak-vbeln.
SELECT * FROM vbfa INTO TABLE fvbfa WHERE vbelv = wa_vbap-vbeln
AND posnv = wa_vbap-posnr.
SELECT * FROM vbup INTO TABLE fvbup WHERE vbeln = wa_vbap-vbeln
AND posnr = wa_vbap-posnr.
SELECT * FROM vbap INTO TABLE fvbap WHERE vbeln = wa_vbap-vbeln
AND posnr = wa_vbap-posnr.
SELECT * FROM vbep INTO TABLE it_vbepvb WHERE vbeln = wa_vbap-vbeln
AND posnr = wa_vbap-posnr.
CALL FUNCTION 'RV_SCHEDULE_CHECK_DELIVERIES'
EXPORTING
fbeleg = wa_vbap-vbeln
fposnr = wa_vbap-posnr
FVERRECHNUNG = ' '
FS073_ALT = ' '
IF_NO_SORT = ' '
TABLES
fvbfa = fvbfa
fvbup = fvbup
fxvbep = it_vbepvb
FVBLB =
fvbap = fvbap
EXCEPTIONS
FEHLER_BEI_LESEN_FVBUP = 1
FEHLER_BEI_LESEN_FXVBEP = 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.
SORT it_vbepvb BY vbeln posnr edatu.
LOOP AT it_vbepvb INTO wa_vbepvb
WHERE vbeln = wa_vbap-vbeln
AND posnr = wa_vbap-posnr.
to write data of schedule line with no delivery
MOVE wa_vbepvb-olfmng_flt TO wa_itab-openqty.
IF wa_vbepvb-bmeng EQ wa_itab-openqty.
CLEAR wa_itab.
PERFORM schedule_data. "schedule line based data to be displayed
MOVE: wa_vbap-lgort TO wa_itab-lgort.
MOVE: wa_vbepvb-etenr TO wa_itab-etenr,
wa_vbepvb-bmeng TO wa_itab-kwmeng,
wa_vbepvb-olfmng_flt TO wa_itab-openqty.
APPEND wa_itab TO it_itab .
CLEAR wa_itab.
ENDIF.
LOOP AT it_vbfa INTO wa_vbfa WHERE vbelv = wa_vbepvb-vbeln
AND posnv = wa_vbepvb-posnr.
READ TABLE it_likp INTO wa_likp WITH KEY vbeln = wa_vbfa-vbeln.
CHECK wa_likp-bldat >= wa_vbepvb-edatu.
check the Delivery doc date with the schedule line confirmed date
CLEAR: delbal, deltot,wa_new.
LOOP AT it_new INTO wa_new WHERE vbeln = wa_vbepvb-vbeln
AND posnr = wa_vbepvb-posnr
AND etenr = wa_vbepvb-etenr.
deltot = deltot + wa_new-sdval.
ENDLOOP.
delbal = wa_new-sdtotval - deltot.
CHECK sy-subrc <> 0 OR delbal GT 0.
MOVE wa_vbepvb-olfmng_flt TO wa_itab-openqty.
CHECK wa_vbepvb-bmeng NE wa_itab-openqty.
****To check whether this delivery is already fully allocated against
any other schedule.
LOOP AT it_lips INTO wa_lips WHERE vbeln = wa_vbfa-vbeln
AND posnr = wa_vbfa-posnn.
MOVE: wa_likp-bolnr TO wa_itab-vesname.
MOVE: wa_likp-vbeln TO wa_itab-delno.
MOVE: wa_likp-wadat TO wa_itab-wadat.
MOVE: wa_likp-anzpk TO wa_itab-anzpk.
MOVE: wa_likp-lddat TO wa_itab-lddat.
MOVE: wa_likp-ernam TO wa_itab-ernam.
******end of code added by IVL1 on sep 27 2007 #3618
PERFORM schedule_data.
IF wa_lips-umvkz <> 0.
tempquant = wa_lips-umvkn / wa_lips-umvkz.
ELSE.
tempquant = wa_lips-umvkn. "delivery qty
ENDIF.
tempquant = tempquant * wa_vbfa-rfmng.
***New logic added to get delivery qty schedule wise****
MOVE: wa_vbepvb-etenr TO wa_itab-etenr,
wa_vbepvb-bmeng TO wa_itab-kwmeng,
wa_vbepvb-olfmng_flt TO wa_itab-openqty. "jo
**if delivery qty is less than or equal to schedule line qty******
IF tempquant LE wa_vbepvb-bmeng.
wa_itab-delqty = tempquant.
LOOP AT it_new INTO wa_new WHERE vbeln = wa_vbepvb-vbeln
AND posnr = wa_vbepvb-posnr
AND etenr = wa_vbepvb-etenr
AND delno = wa_lips-vbeln
AND delposnr = wa_lips-posnr.
MOVE-CORRESPONDING wa_itab TO wa_new.
wa_new-delposnr = wa_lips-posnr.
wa_new-val = tempquant.
wa_new-totval = tempquant.
wa_new-sdval = tempquant.
wa_new-sdtotval = wa_vbepvb-bmeng.
MODIFY TABLE it_new FROM wa_new .
IF NOT sy-subrc IS INITIAL.
APPEND wa_new TO it_new.
ENDIF.
ENDLOOP.
IF sy-subrc <> 0.
MOVE-CORRESPONDING wa_itab TO wa_new.
wa_new-delposnr = wa_lips-posnr.
wa_new-val = tempquant.
wa_new-totval = tempquant.
wa_new-sdval = tempquant.
wa_new-sdtotval = wa_vbepvb-bmeng.
APPEND wa_new TO it_new.
ENDIF.
wa_itab-delqty = tempquant.
CLEAR tempquant.
ELSE.
lips qty > so schedule lineqty
CLEAR deltol.
LOOP AT it_new INTO wa_new WHERE vbeln = wa_vbepvb-vbeln
AND posnr = wa_vbepvb-posnr
AND etenr = wa_vbepvb-etenr
AND delno = wa_lips-vbeln
AND delposnr = wa_lips-posnr.
deltol = deltol + wa_new-val.
ENDLOOP.
LOOP AT it_new INTO wa_new WHERE vbeln = wa_vbepvb-vbeln
AND posnr = wa_vbepvb-posnr
AND delno = wa_lips-vbeln
AND delposnr = wa_lips-posnr.
MOVE-CORRESPONDING wa_itab TO wa_new.
wa_new-val = wa_new-totval - deltol.
wa_itab-delqty = wa_new-val.
wa_new-delposnr = wa_lips-posnr.
wa_new-totval = tempquant.
wa_new-sdval = wa_new-val.
wa_new-sdtotval = wa_vbepvb-bmeng.
MODIFY TABLE it_new FROM wa_new .
IF NOT sy-subrc IS INITIAL.
APPEND wa_new TO it_new.
ENDIF.
ENDLOOP.
IF sy-subrc <> 0.
MOVE-CORRESPONDING wa_itab TO wa_new.
wa_itab-delqty = wa_vbepvb-bmeng.
wa_new-delposnr = wa_lips-posnr.
wa_new-val = wa_vbepvb-bmeng.
wa_new-totval = tempquant.
wa_new-sdval = wa_vbepvb-bmeng.
wa_new-sdtotval = wa_vbepvb-bmeng.
APPEND wa_new TO it_new.
ENDIF.
ENDIF.
IF NOT wa_lips-lgort IS INITIAL.
MOVE: wa_lips-lgort TO wa_itab-lgort.
ELSE.
MOVE: wa_vbap-lgort TO wa_itab-lgort.
ENDIF.
APPEND wa_itab TO it_itab .
CLEAR wa_itab.
ENDLOOP.
ENDLOOP.
CLEAR wa_vbepvb.
ENDLOOP.
ENDLOOP.
CLEAR wa_vbak.
ENDLOOP. -
Relation between Billing line Item and Accounting doc entries
Hi all
when r line items in Accounting doc gets generated for a billing doc.
for ex. if there exists a Billing Doc with 2 lines
is there any relation to the item in the Billing Doc
to the Accounting doc line items.
thanksHi,
In some situation it is possible that there is a link but in the most situation you use summarization to minalize the number of line items created by invoice (like one line for VAT, general discounts). The total ammount from the customer is the same as on the billing document.
When you want to have details by line you can found them in CO-PA.
Paul -
I have a requirement where in i have to display a pop up with all the line items given by user in ME21N . The pop up has to display when user presses CHECK .
I written the code in the exit EXIT_SAPMM06E_017 . its working fine for single line item.
In case of multiple line items the popup appears for every line item instead of showing all the line items in a single pop up since in the user exit there is no provision of capturing the LAST LINE ITEM . The field EKKO-LPONR which captures the last line item , is populated only after the exit is triggered which captures the value of EKPO-EBELP( line-item). I manage to capture the line items in internal table but unable to capture last line item and then display the internal table in pop up .
If the user gives two line items say 10 , 20 .
Line item 10 is populated to field EKPO-EBELP . After the control comes out of the exit the value of EBELP is assigned to LPONR . At next control LPONR = 10 and EBELP = 20.
Thanks .Hi Priya,
To show popup for the last line item, try with this logic:
You have an internal table with all line items, take an internal table with same structure. Take the number of lines and read the line iten into work area and append this work area into another table. after that read this second internal table with EBELN and EBELP, if it is matching then show the popup for all line items from first internal table.
Put this code:
<b>dsescribe int_first into ws_lines.
if ws_lines gt 0.
read table int_first into wa_first index ws_lines.
if sy-subrc eq 0.
append wa_first to int_second.
endif.
endif.
if not int_second is initial.
read int_second into wa_first with key EBELN = 'structure ebeln value'
EBELP = 'structure ebelp value'
if sy-subrc eq 0.
" put POPUP code
endif.
endif.</b>
Hope it will solve ur problem. -
Final total cannot appear when the last line item reached the page end
Hi All,
My report included 2 pages. Problem is the final total cannot appear when the last line item reached the page end. (page 2)
final total will appear on the middle of last page (page 3) when i comment (type = 'BOTTOM').
Below is the program.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
device = 'PRINTER'
dialog = 'X'
form = 'ZBOTM_VOUCHER'
language = sy-langu.
sort itab by vblnr.
LOOP AT itab INTO wa_itab.
move wa_itab-vblnr to reguh-vblnr.
move wa_itab-lifnr to reguh-lifnr.
move wa_itab-rbetr to reguh-rbetr.
reguh-rbetr = reguh-rbetr * -1.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
window = 'MAIN'
element = 'DETAIL'.
t_rbetr = reguh-rbetr + t_rbetr.
AT LAST.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
window = 'LINE'.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'TOTAL'.
type = 'BOTTOM'
WINDOW = 'MAIN'.
ENDAT.
Thanks.Hi,
Where should I include the code for bottom?
How to open text editor?
Thanks.
Edited by: Alice8 on Feb 7, 2011 9:09 AM -
Printing in only last line item printing in main window
Hi All,
My requiremnet is to print same data in two blocks for F110 payment cheque
Iam using 2 main windows to print same data if block exceeds it will go to next page
iam calling the windows as shown below
CALL FUNCTION 'WRITE_FORM'
EXPORTING
window = 'MAIN00'
element = hlp_ep_element
function = 'APPEND'
EXCEPTIONS
window = 1
element = 2.
IF sy-subrc EQ 2.
err_element-fname = t042e-zforn.
err_element-fenst = 'MAIN00'.
err_element-elemt = hlp_ep_element.
err_element-text = text_525.
COLLECT err_element.
ENDIF.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
window = 'MAIN01'
element = hlp_ep_element
function = 'APPEND'
EXCEPTIONS
window = 1
element = 2.
IF sy-subrc EQ 2.
err_element-fname = t042e-zforn.
err_element-fenst = 'MAIN01'.
err_element-elemt = hlp_ep_element.
err_element-text = text_525.
COLLECT err_element.
ENDIF.
Iam getting only last line item printing in main window
Please provide the inputs.
Thanks,
Kamalakar.
Please use code tags.
Edited by: Rob Burbank on Nov 25, 2011 11:51 AMHi,
My requirement was to print same block twice in cheque printing of F110.
I have used the function module 'WRITE_FORM_LINES' to print more than one line item in secondary window in the script .
fill the Lines internal table as shown below.
Example :
lines-tdformat = 'TM'.
CONCATENATE regup-xblnr ',,' w_date ',,' w_bsak-sgtxt ',,' w_gross ',,' w_dis ',,'
w_net INTO lines-tdline.
APPEND lines.
CALL FUNCTION 'WRITE_FORM_LINES'
EXPORTING
function = 'APPEND'
header = header_t
type = 'BODY'
window = 'MAIN01'
IMPORTING
FROMPAGE =
PENDING_LINES =
TABLES
lines = lines
EXCEPTIONS
function = 1
type = 2
unopened = 3
unstarted = 4
window = 5
bad_pageformat_for_print = 6
spool_error = 7
codepage = 8
OTHERS = 9
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF. -
Unable to find line break between two lines in attachment file.
Dear all I will be very great full if someone help me out,
I am trying to send mail through SMTP server with an attachment of oracle report, but I am unable to find line break between two lines, when I down load the attachment from mail and open attach.txt file by double click on it. Next line starts right after previous line ends, it should starts with new line.
In order to send an attachment file, I am reading source file line by line and put MIME protocol’s attachment instance, contain of source file is being properly written into target file if I open that attachment on cmd prompt.
Following code may help you to understand the case.
Thanks in advance.
My code is as follows:-
create or replace procedure bec_file_test
v_subject varchar2, -- Subject of the email
v_body varchar2, -- Body of the email
v_from VARCHAR2 default 'XYZ.com', -- sender mail id
v_to varchar2 default 'XYZ.com', -- Field To of the email
v_cc varchar2 default 'XYZ.com' -- cc address
) is
-- variable to hold the smtp server connection
v_smtp_connection utl_smtp.connection;
-- variable to hold the smtp host name
v_smtp_host varchar2(100) default 'mail.bec-group.com';
-- variable to hold the smtp port
v_smtp_port number default 25;
-- composite of {CR}{LF} caridge return and line feed.
CRLF varchar2(2):=CHR(13)||CHR(10);
cursor pr_rec is
select requisition_no,line_no,release_no,a.contract,
a.project_id,substr(a.activity_seq,1,11)ACT_SEQ,
substr(a.part_no,1,12)PART_NO,
substr(a.description,1,32)DESCRIPTION,
substr(a.Bal_qty,1,8) BAL_QTY,
substr(a.unit_meas,1,5)UOM,
a.wanted_receipt_date WAN_REC_DT,
a.latest_order_date LAT_ORD_DT
from bec_pr_line_rep a
where a.Bal_qty>0 and a.header_state not in 'Closed'
and upper(a.state1) like 'RELEASED' and a.contract not in ('U1ENG','ULENG','U1FND','U2FND')
and a.buyer_code='70306'
order by a.part_no;
begin
declare
fHandle UTL_FILE.FILE_TYPE;
v_msg_line varchar2(2000);
-- v_buffer varchar2(20000);
--ALTER SYSTEM SET utl_file_dir = 'D:\Database\temp'
--COMMENT='Temporary change on Dec 14'
--SCOPE=SPFILE;
SELECT name, value
FROM gv$parameter
WHERE name = 'utl_file_dir';
--drop directory my_directory
--CREATE or replace DIRECTORY my_directory AS 'D:\database\temp';
--GRANT read,write ON DIRECTORY my_directory TO PUBLIC;
begin ---writing data into a file.
fHandle := UTL_FILE.FOPEN('MY_DIRECTORY', 'pending_pr_summry.txt', 'w');
UTL_FILE.put_line(fHandle, ' Pending PR to process (detail report)');
UTL_FILE.put_line(fHandle,TO_CHAR(SYSDATE,'MM-DD-YY HH:MI:SS AM'));
UTL_FILE.put_line(fHandle, '--------------------------------------------------------------------------------------------------------------------------------------------------');
UTL_FILE.put_line(fHandle, 'Req.no. li Re Site Prj Id Act seq Part no Description Qty UOM want rec dt lat ord dt' );
UTL_FILE.put_line(fHandle, '--------------------------------------------------------------------------------------------------------------------------------------------------');
for pr_temp in pr_rec loop
begin
v_msg_line:=to_char(rpad(pr_temp.requisition_no,12,' ')||'|'||
lpad(pr_temp.line_no,3,' ')||'|'||
lpad(pr_temp.release_no,3,' ')||'|'||
rpad(pr_temp.contract,7,' ')||'|'||
lpad(nvl(pr_temp.project_id,' '),7,' ')||'|'||
lpad(nvl(pr_temp.act_seq,' '),12,' ')||'|'||
lpad(pr_temp.part_no,12,' ')||'|'||
rpad(pr_temp.description,35,' ')||'|'||
lpad(pr_temp.bal_qty,10,' ')||'|'||
rpad(pr_temp.uom,6,' ')||'|'||
lpad(pr_temp.wan_rec_dt,14,' ')||'|'||
lpad(pr_temp.lat_ord_dt,14,' '));
UTL_FILE.put_line(fHandle,v_msg_line);
end;
end loop;
UTL_FILE.put_line(fHandle, '--------------------------------------------------------------------------------------------------------------------------------------------------');
UTL_FILE.put_line(fHandle, ' Regards : IFSAPP ( Application owner ) ');
UTL_FILE.FCLOSE(fHandle); ------------writing into file is successfuly done here!
--Reading of file starts here containt will be added in attchment file
fHandle :=UTL_FILE.FOPEN('MY_DIRECTORY','pending_pr_summry.txt','R' );
-- establish the connection to the smtp server
v_smtp_connection := utl_smtp.open_connection(v_smtp_host, v_smtp_port); /** OPEN CONNECTION ON THE SERVER **/
-- perform a handshake with the smtp server
utl_smtp.helo(v_smtp_connection, v_smtp_host); /** DO THE INITIAL HAND SHAKE **/
-- set the 'from' address of the message
utl_smtp.mail(v_smtp_connection, v_from);
-- add the recipient to the message
utl_smtp.rcpt(v_smtp_connection, v_to);
-- send the email
utl_smtp.open_data(v_smtp_connection);
v_msg_line:='Date: ' || TO_CHAR( SYSDATE, 'dd Mon yy hh24:mi:ss' ) || CRLF ||
'From: ' || v_from || CRLF ||
'Subject: ' || v_subject || CRLF ||
'To: ' || v_to || CRLF ||
'Cc: ' || v_cc || CRLF ||
'MIME-Version: 1.0'|| CRLF || -- Use MIME mail standard
'Content-Type: multipart/mixed;'||CRLF ||
' boundary="-----SECBOUND"'||CRLF||
CRLF ||'-------SECBOUND'|| CRLF ||
'Content-Type: text/plain;'|| CRLF ||
'Content-Transfer_Encoding: 7bit'|| CRLF ||
CRLF ||v_body|| CRLF; -- Message body
utl_smtp.write_data(v_smtp_connection,v_msg_line);
v_msg_line:='-------SECBOUND'|| CRLF ||
'Content-Type: application/octet-stream;'|| CRLF ||
'Content-Type: text/plain;'|| CRLF ||
'name="pending_pr_summry.txt"'|| CRLF ||
'Content-Transfer_Encoding: 8bit'|| CRLF ||
'Content-Disposition: attachment;'|| CRLF ||
' filename="pending_pr_summry.txt"'|| CRLF || CRLF; -- Content of attachment
utl_smtp.write_data(v_smtp_connection,v_msg_line);
-- check file is opened
IF utl_file.is_open(fHandle) THEN
-- loop lines in the file
LOOP
BEGIN -- Content of attachment
utl_file.get_line(fHandle,v_msg_line);
v_msg_line:=concat(v_msg_line,CRLF);
utl_smtp.write_data(v_smtp_connection,v_msg_line);
EXCEPTION
WHEN NO_DATA_FOUND THEN
EXIT;
END;
END LOOP;
END IF;
--end of attachment containt
utl_smtp.write_data(v_smtp_connection,v_msg_line);
UTL_FILE.FCLOSE(fHandle);
utl_smtp.close_data(v_smtp_connection);
utl_smtp.quit(v_smtp_connection);
exception
when utl_smtp.invalid_operation then
dbms_output.put_line(' Invalid Operation in Mail attempt using UTL_SMTP.');
when utl_smtp.transient_error then
dbms_output.put_line(' Temporary e-mail issue - try again');
when utl_smtp.permanent_error then
dbms_output.put_line(' Permanent Error Encountered.');
when others then
dbms_output.put_line('Exception: SQLCODE=' || SQLCODE || ' SQLERRM=' || SQLERRM);
RAISE;
end;
end bec_file_test;Pending PR to process (detail report)01-17-13 12:43:19 PM--------------------------------------------------------------------------------------------------------------------------------------------------Req.no. li Re Site Prj Id Act seq Part no Description Qty UOM want rec dt lat ord dt--------------------------------------------------------------------------------------------------------------------------------------------------MAT/250370 | 2| 1|ISCSP | 4977| 100004207| 0104000016|Angle 50 X 50 X 6 IS:2062 Grade |500|kg |30-NOV-2012| 20-nov-2012MAT/250370 | 3| 1|ISCSP | 4977| 100004207| 0105000002|Channel 100 X 50 IS:2062 Grade A | 1000|kg | 30-NOV-2012| 20-nov-2012MAT/250579 | 2| 1|NMDCJ | 6001| 100005580| 0109020002|TMT Bar 10 mm Fe 415 IS:1786 | 2991|kg | 13-DEC-2012| 03-dec-2012MAT/250606 | 2| |NMDCJ | 6002| 100005860| 0109020002|TMT Bar 10 mm Fe 415 IS:1786 | 4500|kg | 29-DEC-2012| 19-dec-2012MAT/250607 | |1|NMDCJ|6001|100005580| 0109020002|TMT Bar 10 mm Fe 415 IS:1786 | 1500|kg | 29-DEC-2012| 19-dec-2012MAT/250194 | 3| 1|NMDCJ | 6002| 100005818| 0109020002|TMT Bar 10 mm Fe 415 IS:1786 | 3939|kg | 29-DEC-2012| 19-dec-2012MAT/250606 | 4| 1|NMDCJ | 6002| 100005860| 0109020004|TMT Bar 16 mm Fe 415 IS:1786 | 39000|kg | 29-DEC-2012| 19-dec-2012MAT/250607 | 4| 1|NMDCJ | 6001| 100005580| 0109020004|TMT Bar 16 mm Fe 415 IS:1786 | 17500|kg | 29-DEC-2012| 19-dec-2012MAT/250194 | 2| 1|NMDCJ | 6002| 100005818| 0109020004|TMT Bar 16 mm Fe 415 IS:1786 | 12183|kg | 29-DEC-2012| 19-dec-2012MAT/250606 | 6| 1|NMDCJ | 6002| 100005860| 0109020006|TMT Bar 25 mm Fe 415 IS:1786 | 9500|kg | 29-DEC-2012| 19-dec-2012MAT/250607 | 6| 1|NMDCJ | 6001| 100005580| 0109020006|TMT Bar 25 mm Fe 415 IS:1786 | 4500|kg | 29-DEC-2012| 19-dec-2012MAT/250194 | 6| 1|NMDCJ | 6002| 100005818| 0109020006|TMT Bar 25 mm Fe 415 IS:1786 | 17500|kg | 29-DEC-2012| 19-dec-2012MAT/250607 | 7| 1|NMDCJ | 6001| 100005580| 0109020008|TMT Bar 32 mm Fe 415 IS:1786 | 22000|kg | 29-DEC-2012| 19-dec-2012MAT/250194 | 7| 1|NMDCJ | 6002| 100005818| 0109020008|TMT Bar 32 mm Fe 415 IS:1786 | 27060|kg | 29-DEC-2012| 19-dec-2012MAT/251138 | 1| 1|NMDCJ | 6002| 100005825| 3501000001|Cement 50 kg | 1|pkt | 25-DEC-2013| 14-dec-2013--------------------------------------------------------------------------------------------------------------------------------------------------
where as source file is like that:-
Pending PR to process (detail report)
01-17-13 12:43:19 PM
Req.no. li Re Site Prj Id Act seq Part no Description Qty UOM want rec dt lat ord dt
MAT/250370 | 2| 1|ISCSP | 4977| 100004207| 0104000016|Angle 50 X 50 X 6 IS:2062 Grade | 5500|kg | 30-NOV-2012| 20-nov-2012
MAT/250370 | 3| 1|ISCSP | 4977| 100004207| 0105000002|Channel 100 X 50 IS:2062 Grade A | 1000|kg | 30-NOV-2012| 20-nov-2012
MAT/250579 | 2| 1|NMDCJ | 6001| 100005580| 0109020002|TMT Bar 10 mm Fe 415 IS:1786 | 2991|kg | 13-DEC-2012| 03-dec-2012
MAT/250606 | 2| 1|NMDCJ | 6002| 100005860| 0109020002|TMT Bar 10 mm Fe 415 IS:1786 | 4500|kg | 29-DEC-2012| 19-dec-2012
MAT/250607 | 2| 1|NMDCJ | 6001| 100005580| 0109020002|TMT Bar 10 mm Fe 415 IS:1786 | 1500|kg | 29-DEC-2012| 19-dec-2012
MAT/250194 | 3| 1|NMDCJ | 6002| 100005818| 0109020002|TMT Bar 10 mm Fe 415 IS:1786 | 3939|kg | 29-DEC-2012| 19-dec-2012
MAT/250606 | 4| 1|NMDCJ | 6002| 100005860| 0109020004|TMT Bar 16 mm Fe 415 IS:1786 | 39000|kg | 29-DEC-2012| 19-dec-2012
MAT/250607 | 4| 1|NMDCJ | 6001| 100005580| 0109020004|TMT Bar 16 mm Fe 415 IS:1786 | 17500|kg | 29-DEC-2012| 19-dec-2012
MAT/250194 | 2| 1|NMDCJ | 6002| 100005818| 0109020004|TMT Bar 16 mm Fe 415 IS:1786 | 12183|kg | 29-DEC-2012| 19-dec-2012
MAT/250606 | 6| 1|NMDCJ | 6002| 100005860| 0109020006|TMT Bar 25 mm Fe 415 IS:1786 | 9500|kg | 29-DEC-2012| 19-dec-2012
MAT/250607 | 6| 1|NMDCJ | 6001| 100005580| 0109020006|TMT Bar 25 mm Fe 415 IS:1786 | 4500|kg | 29-DEC-2012| 19-dec-2012
MAT/250194 | 6| 1|NMDCJ | 6002| 100005818| 0109020006|TMT Bar 25 mm Fe 415 IS:1786 | 17500|kg | 29-DEC-2012| 19-dec-2012
MAT/250607 | 7| 1|NMDCJ | 6001| 100005580| 0109020008|TMT Bar 32 mm Fe 415 IS:1786 | 22000|kg | 29-DEC-2012| 19-dec-2012
MAT/250194 | 7| 1|NMDCJ | 6002| 100005818| 0109020008|TMT Bar 32 mm Fe 415 IS:1786 | 27060|kg | 29-DEC-2012| 19-dec-2012
MAT/251138 | 1| 1|NMDCJ | 6002| 100005825| 3501000001|Cement 50 kg | 1 |pkt | 25-DEC-2013| 14-dec-2013
Ignore alignment. It is well formatted in source file. -
Only the last line item is shown in main window...
Hello Experts,
I created a custom form for the standard checque program RFFOUS_C. Now, in my MAIN window, I
called a subroutine in a custom program which loops through the line items but the problem is
only the last line item is being shown. I tried using CONTROL_FORM to create a new line
but it does not work. Note that I did not customize RFFOUS_C since it is being used by
multiple companies. Below is my code:
SAPSCRIPT:
510-C
Begin of insertion DEVK940799 11/10/2008 DEL_HIDALGO
DEFINE <YC_XBLNR& = ''
DEFINE <YC_BLDAT& = ''
DEFINE <YC_SGTXT& = ''
DEFINE <YC_DMBTR& = ''
PERFORM WRITE_LINE_ITEMS IN PROGRAM Z9999RFI_Z2574FFI_RA
USING ®UH-LAUFD&
USING ®UH-LAUFI&
USING ®UH-XVORL&
USING ®UH-ZBUKR&
USING ®UH-LIFNR&
USING ®UH-VBLNR&
CHANGING <YC_XBLNR&
CHANGING <YC_BLDAT&
CHANGING <YC_SGTXT&
CHANGING <YC_DMBTR&
ENDPERFORM
PROTECT
<YC_XBLNR& <YC_BLDAT& <YC_SGTXT& <YC_DMBTR&
ENDPROTECT
End of insertion DEVK940799 11/10/2008 DEL_HIDALGO
PROGRAM:
IF gt_regup[] IS NOT INITIAL.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
* APPLICATION = 'TX'
* ARCHIVE_INDEX =
* ARCHIVE_PARAMS =
* DEVICE = 'PRINTER'
* DIALOG = 'X'
form = lcc_z2574ffi_ra
* LANGUAGE = SY-LANGU
* OPTIONS =
* MAIL_SENDER =
* MAIL_RECIPIENT =
* MAIL_APPL_OBJECT =
* RAW_DATA_INTERFACE = '*'
* SPONUMIV =
* IMPORTING
* LANGUAGE =
* NEW_ARCHIVE_PARAMS =
* RESULT =
EXCEPTIONS
canceled = 1
device = 2
form = 3
OPTIONS = 4
unclosed = 5
mail_options = 6
archive_error = 7
invalid_fax_number = 8
more_params_needed_in_batch = 9
spool_error = 10
codepage = 11
OTHERS = 12.
IF sy-subrc <> 0.
* MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
* WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
LOOP AT gt_regup INTO lw_regup.
m_line_items 'LTYC_XBLNR' lw_regup-xblnr.
m_line_items 'LTYC_BLDAT' lw_regup-bldat.
m_line_items 'LTYC_SGTXT' lw_regup-sgtxt.
m_line_items 'LTYC_DMBTR' lw_regup-dmbtr.
DELETE ex_output WHERE value IS INITIAL.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = '510-C'
function = 'APPEND'
* TYPE = 'BODY'
window = 'MAIN'
* IMPORTING
* PENDING_LINES =
EXCEPTIONS
element = 1
function = 2
type = 3
unopened = 4
unstarted = 5
window = 6
bad_pageformat_for_print = 7
spool_error = 8
codepage = 9
OTHERS = 10.
IF sy-subrc <> 0.
* MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
* WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL FUNCTION 'CONTROL_FORM'
EXPORTING
command = 'NEW-LINE'
EXCEPTIONS
unopened = 1
unstarted = 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.
ENDLOOP.
CALL FUNCTION 'CLOSE_FORM'
* IMPORTING
* RESULT =
* RDI_RESULT =
* TABLES
* OTFDATA =
EXCEPTIONS
unopened = 1
bad_pageformat_for_print = 2
send_error = 3
spool_error = 4
codepage = 5
OTHERS = 6.
IF sy-subrc <> 0.
* MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
* WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDIF.Hi,
Write the at last event in the program and check if it works
At last.
CALL FUNCTION 'CONTROL_FORM'
EXPORTING
command = 'NEW-LINE'
EXCEPTIONS
unopened = 1
unstarted = 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.
Regards,
Sravanthi -
Need to skip page break between header and Detail sections
Hello,
I am combining two reports in one report (one in header section and another report in the body section). when this report is run, there's a page break between these two sections. Is it possible to eliminate it? Ideally I would like the detail section to start as soon as the header section of the report is completed in the same page instead of starting (detail section report) in a new page.
Any help is highly appreciated. Thanks,
SundarI'd put them into one section to control the breaks.
-
Select last line item from VBAP
Dear SAP experts,
This might sound very silly question but I am new to SAP world.
is there a simple select statement to select only higest line item.
Say for example in VBAP, I have 9 line items.
then my select statement should find the last line item. ie. 9th item.
Actually, I have a situation where a custom table has 2 key fields and I want to select the only 1 line with higest number in 2nr column. Thank you.
Anitha.Hi,
types: BEGIN OF ls_vbap,
vbeln TYPE vbap-vbeln,
posnr TYPE vbap-posnr,
END OF ls_vbap.
DATA : t_vbap TYPE STANDARD TABLE OF vbap WITH HEADER LINE,
wa_vbap type ls_vbap.
data: lv_line type int4.
SELECT vbeln posnr FROM kna1 INTO TABLE t_vbap.
*****If you just need the last record then write the code as shown below:
DESCRIBE TABLE t_vbap LINES lv_line.
READ TABLE t_vbap INTO wa_vbap INDEX lv_line.
if sy-subrc = 0.
write:/ wa_vbap-vbeln.
endif.
If you the need the last record after sorting then use the below code:
SORT t_vbap by vbeln posnr DESCENDING.
READ TABLE t_vbap into wa_vbap index 1.
if sy-subrc = 0.
write:/ wa_vbap-vbeln.
endif.
Maybe you are looking for
-
This is written for the Playbook blog writer in the hope that he will see it here and post a blog answer. However, a reply from anyone would be appreciated. Thanks. [2 questions about PPBB OS 2.0+] Hi. Thanks for your very informative blog. I would a
-
Short Dump During List processing
Hi , Problem Desc: A program when it runs in production has huge number of data to be displayed in the list .While doing the write statement the internal table(system assigned internal table for list processing '%_LIST') exceeds the memory limit
-
The Ebook seller had reset the ebook so I can download the link again and I have received the same message. Today, October 13th, 2013, I deleted my Adobe Digital Editions App, downloaded it again, reinstalled it without any errors. I can open up an
-
Dynamically change Database, Server and Command From VB6
I have a crystal report which connects to an iSeries box via an OLE DB datasource, however i need to have this same report conect to two different iSeries, with the tables for the sql (command) located in two different libraries. Is it possible to ch
-
HT201320 how to read mac mail on iPhone?
want to be able to read mac mail on iphone instead of reading mail directly from comast.