Smartforms help
hi folks,
I have been successfully displaying the data in the body of the form (i.e pulling all the data into the fields) in the form.
My question is the data is not getting displayed on the same line in all the fields, because in some fields it just a single line data, whereas in some fields it has two to three lines of data.
I am looking for proper alignment of data on a line by line basis in the form.
How to adjust this data placement in the fields in the form ?
Thanks
Santhosh
Hi Vinod,
I went ahead and created a template node under the 'Main Window' node and also I have the table node declared under it, infact I want this alignment for displaying the data in aproper line within the table.
How can i do that? Can you elaborate how can i use this template node within the table node declared ?
Thanks
Santhosh
Similar Messages
-
Hello friends,
could you send me the link which i can download to read the smartform help.
Thanking youBest place is to look at SAP help. Follow the link
http://help.sap.com/
Also
http://www.sap-basis-abap.com/sapsf001.htm
http://www.sapgenie.com/abap/smartforms.htm
Message was edited by: Vinod C -
Error while emailing pdf Smartform- help needed
Hi All,
I have successsully saved smartform as pdf on my local machine and while trying to send the same as an attachment.i am encountering a run time error in SCOT transaction on pressing send message.
Error details are as follows:-
CPIC-CALL: THE SAPECMINIT UNABLE TO DETERMINE HOST ADDRESS
Source Code: SAPMSSY1
CALL RFCIMPORT
The program is given below. Kindly reply me the solution.
All helpful answers will b rewarded.
Regards,
Eureka.
*& Report Z24436_SMARTFORM2 *
REPORT Z24436_SMARTFORM2 .
Global Variables Declarations
DATA: MAt_id TYPE MATNR VALUE '1%',
fm_name TYPE rs38l_fnam.
DATA: ITAB_MAkt TYPE STANDARD TABLE OF MAkt.
DATA: p_form TYPE tdsfname VALUE 'ZUDAY_SMARTFORMS1'.
All Database Selections are here
*Getting Materials belonging to the given plant
SELECT * FROM MAkt INTO TABLE ITAB_MAkt
WHERE MATNR LIKE MAT_id.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = p_form
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
fm_name = fm_name
EXCEPTIONS
no_form = 1
no_function_module = 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.
EXIT.
ENDIF.
DATA : gw_ssfcrescl TYPE ssfcrescl.
DATA: gt_otf TYPE STANDARD TABLE OF itcoo ,
gt_tline TYPE STANDARD TABLE OF tline,
gt_pdf TYPE STANDARD TABLE OF tline,
gv_len LIKE sood-objlen,
gw_ssfctrlop TYPE ssfctrlop, "for CONTROL_PARAMETERS
gw_ssfcompop TYPE ssfcompop. "for OUTPUT_OPTIONS
gw_ssfctrlop-getotf = 'X'.
gw_ssfctrlop-no_dialog = 'X'.
gw_ssfcompop-tdnoprev = 'X'.
**Calling the generated function module
CALL FUNCTION fm_name
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS = gw_ssfctrlop
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS = gw_ssfcompop
USER_SETTINGS = 'X'
customer_info = customer
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO = gw_ssfcrescl
JOB_OUTPUT_OPTIONS =
TABLES
it_makt = itab_makt
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
gt_otf[] = gw_ssfcrescl-otfdata[].
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = gv_len
TABLES
otf = gt_otf
lines = gt_pdf
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
DATA:
gt_pdf TYPE TABLE OF tline,
gt_xi_pdf TYPE TABLE OF tline,
gt_pdf_conv TYPE TABLE OF solisti1,
gt_xi_temp TYPE TABLE OF bapiqcmime.
CONSTANTS:
lc_x(1) TYPE c VALUE 'X',
lc_raw(3) TYPE c VALUE 'RAW',
lc_pdf(3) TYPE c VALUE 'PDF',
lc_attach(12) TYPE c VALUE 'ATTACHMENT'.
DATA:
lv_spool TYPE rspoid, "Spool Number
lv_pdf_size TYPE i, "PDF Size
lv_subject(40) TYPE c, "Email subject
lv_tab_lines TYPE sytabix, "Table Lines
lv_date(10) TYPE c, "Variable for date
lv_time(8) TYPE c. "Variable for Time
DATA:
For Compressing document
ls_objpack TYPE sopcklsti1,
lt_objpack TYPE STANDARD TABLE OF sopcklsti1,
To specify subject
lt_objhead TYPE STANDARD TABLE OF solisti1,
ls_objhead TYPE solisti1,
To send the PDF
lt_objbin TYPE STANDARD TABLE OF solisti1,
ls_objbin TYPE solisti1,
Email body
lt_objtxt TYPE STANDARD TABLE OF solisti1,
ls_objtxt TYPE solisti1,
To specify Receivers
lt_reclist TYPE STANDARD TABLE OF somlreci1,
ls_reclist TYPE somlreci1,
Documenting Data
ls_doc_chng TYPE sodocchgi1,
ls_pdf_conv TYPE solisti1.
CONSTANTS: lc_under(1) TYPE c VALUE '_'.
**Copy the Spool request to a Local Variable
lv_spool = sy-spono.
Convert spool job to PDF
***************this is normal report spool to pdf.
but your case it will be smartform to pdf
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = lv_spool
no_dialog = lc_x
IMPORTING
pdf_bytecount = lv_pdf_size
TABLES
pdf = gt_pdf
EXCEPTIONS
OTHERS = 0.
To Format the PDF file so as each row contains 255 characters
PERFORM page_format .
Transfer the file to objbin table
LOOP AT gt_pdf_conv INTO ls_pdf_conv.
ls_objbin-line = ls_pdf_conv-line.
APPEND ls_objbin TO lt_objbin.
CLEAR ls_objbin.
ENDLOOP.
*// Creating the document to be sent - Mail subject creation
ls_doc_chng-obj_name = sy-repid.
lv_subject = text-008. "Mail subject
WRITE sy-datum TO lv_date USING EDIT MASK '__/__/____'.
WRITE sy-uzeit TO lv_time USING EDIT MASK '__:__:__'.
CONCATENATE lv_subject lc_under lv_date lc_under lv_time
INTO ls_doc_chng-obj_descr.
*// Email body
PDF attachment of Product Allocation for Open orders
ls_objtxt = text-009.
APPEND ls_objtxt TO lt_objtxt.
Write Date when the mail was sent in the email body
CONCATENATE text-010 lv_date INTO ls_objtxt.
APPEND ls_objtxt TO lt_objtxt.
Write Time when the mail was sent in the email body
CONCATENATE text-011 lv_time INTO ls_objtxt.
APPEND ls_objtxt TO lt_objtxt.
DESCRIBE TABLE lt_objtxt LINES lv_tab_lines.
READ TABLE lt_objtxt INTO ls_objtxt INDEX lv_tab_lines.
Calculate the document size
ls_doc_chng-doc_size = ( lv_tab_lines - 1 ) * 255 +
STRLEN( ls_objtxt ).
*// Creating the entry for the compressed document
CLEAR ls_objpack-transf_bin.
ls_objpack-head_start = 1.
ls_objpack-head_num = 0.
ls_objpack-body_start = 1.
ls_objpack-body_num = lv_tab_lines.
ls_objpack-doc_type = 'RAW' . "RAW
APPEND ls_objpack TO lt_objpack.
CLEAR lv_tab_lines.
DESCRIBE TABLE lt_objbin LINES lv_tab_lines.
ls_objhead = ls_doc_chng-obj_descr.
APPEND ls_objhead TO lt_objhead.
*// Creating the entry for the compressed attachment
ls_objpack-transf_bin = lc_x.
ls_objpack-head_start = 1.
ls_objpack-head_num = 1.
ls_objpack-body_start = 1.
ls_objpack-body_num = lv_tab_lines.
ls_objpack-doc_type = 'PDF'. "PDF
ls_objpack-obj_name = 'ATTACHMENT'. "ATTACHMENT
CONCATENATE lv_subject lc_under lv_date lc_under lv_time
INTO ls_objpack-obj_descr.
CLEAR: ls_objbin.
READ TABLE lt_objbin INTO ls_objbin INDEX lv_tab_lines.
ls_objpack-doc_size = ( lv_tab_lines - 1 ) * 255 +
STRLEN( ls_objbin ).
APPEND ls_objpack TO lt_objpack.
ls_reclist-receiver = '[email protected]'.
ls_reclist-receiver = gv_email_addr.
ls_reclist-rec_type = 'U'.
APPEND ls_reclist TO lt_reclist.
IF ls_reclist-receiver IS INITIAL.
MESSAGE i175.
ELSE.
*// Send EMail
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = ls_doc_chng
put_in_outbox = lc_x
commit_work = lc_x
TABLES
packing_list = lt_objpack
object_header = lt_objhead
contents_bin = lt_objbin
contents_txt = lt_objtxt
receivers = lt_reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 3
OTHERS = 99.
CASE sy-subrc.
WHEN 0.
Mail successfully delivered
*// Do nothing
WHEN 1.
This will never occur as at any point of time mail will be
sent to one processor only.
*// Do nothing
WHEN 2.
MESSAGE i175.
WHEN 3.
MESSAGE i175.
*// Do nothing
ENDCASE.
ENDIF.
REFRESH: lt_objpack,
lt_objbin,
lt_objtxt,
lt_objhead,
lt_reclist.
CLEAR: ls_reclist,
ls_doc_chng,
ls_objpack,
ls_objhead,
ls_objtxt.
DATA : gv_filename LIKE rlgrap-filename VALUE 'C:\Udaya4.pdf'.
CALL FUNCTION 'DOWNLOAD'
EXPORTING
bin_filesize = gv_len
filename = gv_filename
filetype = 'BIN'
filetype_no_show = 'X'
IMPORTING
act_filename = gv_filename
filesize = gv_len
cancel = ''
TABLES
data_tab = gt_pdf.
FORM page_format .
Local data
DATA : lv_lines TYPE i,
lv_temp(500) TYPE c,
lv_offset TYPE p,
lv_lineslen(2) TYPE p,
lv_mimelen(2) TYPE p,
lv_tabix LIKE sy-tabix,
ls_pdf_conv TYPE solisti1,
ls_xi_temp TYPE bapiqcmime,
ls_xi_pdf TYPE tline.
CLEAR : gt_xi_pdf,
gt_xi_temp.
REFRESH: gt_xi_pdf,
gt_xi_temp.
Copy the PDF file into table gt_xi_pdf
gt_xi_pdf[] = gt_pdf[].
Reformat the line to 255 characters wide (code from SAP)
CLEAR: lv_temp, lv_offset, gt_xi_temp.
DESCRIBE TABLE gt_xi_pdf LINES lv_lines.
DESCRIBE FIELD ls_xi_pdf LENGTH lv_lineslen IN CHARACTER MODE.
DESCRIBE FIELD ls_xi_temp LENGTH lv_mimelen IN CHARACTER MODE.
Go through all the lines of table gt_xi_pdf
LOOP AT gt_xi_pdf INTO ls_xi_pdf.
lv_tabix = sy-tabix.
Move ls_xi_pdf into lv_temp variable
MOVE ls_xi_pdf TO lv_temp+lv_offset.
Check if its the last line of table gt_xi_pdf
IF lv_tabix = lv_lines.
lv_lineslen = STRLEN( ls_xi_pdf ).
ENDIF.
Calculate the new offset
lv_offset = lv_offset + lv_lineslen.
Check if the new offset is equal to or greater than the length of
gt_xi_temp
IF lv_offset GE lv_mimelen.
CLEAR ls_xi_temp.
Copy the PDF data into gt_xi_temp
ls_xi_temp = lv_temp(lv_mimelen).
APPEND ls_xi_temp TO gt_xi_temp.
SHIFT lv_temp BY lv_mimelen PLACES.
Calculate the new offset
lv_offset = lv_offset - lv_mimelen.
ENDIF. "Offset GE MIMELEN
Check if its the last line of gt_xi_pdf
IF lv_tabix = lv_lines.
Check if lv_temp has some data that is not been transferred to
gt_xi_temp
IF lv_offset GT 0.
CLEAR ls_xi_temp.
Copy the PDF data into gt_xi_temp
ls_xi_temp = lv_temp(lv_offset).
APPEND ls_xi_temp TO gt_xi_temp.
ENDIF. "lv_offset GT 0
ENDIF. "lv_tabix = lv_lines
ENDLOOP.
gt_pdf_conv[] = gt_xi_temp[].
ENDFORM. " page_formatall settings in SCOT is ok ? like SMTP settings , link b/w ur Outlook server and SAP server ?
Regards
Prabhu -
Hi gurus....
my senior did the purchase order form work by smb40 package both smartform and program.....im on the updation work and corrections,if any...here,i need ur help
the problem now im facing is,in the pur order for the doc type 'ZSTO',the rate(konv-kbetr) is not coming out correctly as per the doc posted in me21n......
how to edit the codes in the smatform....and how to get the amount for this doc type......
pls do the needful with ur examples to me.....on urgent basis
thanks & regards
sankarHi
First do you know the smartform and Program name in which you wants to change
otherwise go to TNAPR table or from NACE tcode with the Output type NEU find out the Smartform name and program name.
goto tcode SMARTFORMS, enter the smartform name
In the smartform check the ITEM level MAIN windows and the code related to the Condition types.In the Program Lines in SMARTFORMS there should be some code written , so change that by searching the field NETPR,KWERT and KSCHL
I hope the logic might have written in smartform.
If you don't find the logic in smartform in the Driver program in SE38 you search for the same fields and modify(if it is a Z program)
Regards
Anji -
hi all,
i am creating one smartform.
In Main Window of smartform, i have taken one table.
in that table in main area i have loop and some rows (table lines).
Now if my loop has more data ,than the text i have written in rows comes in next page.
means if i have two lines which i have taken in text of a row, one coming in first page and second coming in next page.
can anybody please help me?
Is it possible that the text of one row comes togather?
means something like PROTECT and ENDPROTECT in Script.
thanks in advance..hi
U want all the table line in once page.. if my understanding is correct then look at the bellow.. u can use the FOLDER node to achive the protection.
<b>1.TABLE>MAINAREA>create a folder by right click.
2.then insert the Table LINE under the FOLDER node..
3.for the FOLDER node check the "page protection check box.</b>
the behaviour of the folder is depends on the number of records and space avialble in the page to print the ercords.
suppose then mian window have the space of 20 line and u have 10 records in ITAB. but u have printer 12 lines of data oter than ITAB data in min window befroe printing the table then the remaining line are only 8 im main window then system triggers next page automatically...
if main window have space for 20 lines and the ITAB have 30 lines then system ignores the PGE protection.
Please Close this thread.. when u r problem is solved. Reward all Helpful answers
Regards
Naresh Reddy K -
Hi,
I have a table in my smartform which is displaying contents from the internal table passed as an interface parameter. The requirement is that there should be a line space between the records of the table .
Can anyone tell me how this can be done?
Thanks in advance
SRhi ,
Underneeth the Main Area of the Table line create a blank Text field with a blank line ( keyboard Enter ) , hope this is what you want to do , if not the question is not clear
Cheers
Dilum -
Smartform help on currency key fields
hi
i want to concatenate wa_ekpo-netpr with currency key ? in smartform i have pass it and display the data. and i want to display the plant t001w details in my top of the form layout how and where i have to write the code how to declare fields?
pls send some steps and codeHi Shilpa,
Here is the method.
In the main program.
DATA: FNAME TYPE RS38L_FNAM.
DATA: ITAB TYPE TABLE OF EKPO WITH HEADER LINE.
SELECT EBELN MATNR NETPR NETWR FROM EKPO INTO CORRESPONDING FIELDS OF TABLE ITAB UP TO 10 ROWS WHERE BUKRS = '1000'.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZSP_SMFORM1'
IMPORTING
FM_NAME = FNAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3
CALL FUNCTION FNAME
TABLES
itab = ITAB[]
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5
In the smartform,
1) In the Form interface, give
ITAB LIKE EKPO
2)In the Global definitions, give
WA_NETPR TYPE EKPO-NETPR
WA_NETWR TYPE EKPO-NETWR
WA_ITAB TYPE EKPO
3)In main window , create a loop(Right click and goto <b>Create->Flow Logic->Loop</b>)
Give the loop as
ITAB INTO WA_ITAB
4) Now create a template(Right click and goto<b>Create->Template</b>).
Create 4 columns(each of 4 CM and height 2 cm)
5) Now create program lines (right click and goto <b>Create->Flow Logic->Program lines</b>.)
In the input parameter, give wa_itab-netpr and wa_itab-netwr
In the output parameter, give wa_netpr and wa_netwr.
In the editor, give the follwoing lines
wa_netpr = wa_itab-netpr.
wa_netwr = wa_itab-netwr.
6) Now create the text (right click and goto<b>Create->text</b>).
In the general attributes for ebeln and matnr , give as
&wa_itab-ebeln and &wa_itab-matnr
For netpr and netwr, give as wa_netpr and wa_netwr.
This will definitely solve your problem.
Regards,
SP. -
I have made a Z version of the driver program /SMB40/FM06P. We have created a new output type that references my Zversion. The issue I have is whenever a change is made to a PO for this new output type, and I click the messages tab the change message flag is never getting set. This isn't the case for output type NEU. Can someone point me in the right direction as to what may be the issue?
I am pretty sure that PO Output is stored in the NAST table. The status can be tracked by using the field VSTAT (there are also a bunch of other fields). However, if output was only on the screen (e.g. preview) and not actually processed, this cannot be tracked.
-
There is no standard smartform for PO In ECC 6.0 R-2
HI Experts
I am not able to getting smartform in my system
how can i installed smartform in my system
My version Is Ecc 6.0 With R-2
Kindly provide all documentation regarding Installation Of smartform
Help Me Out
Need exact solution donu2019t put old ides pleasei am working in sap b1 i want to change field
in SAP NetWeaver .NET Technologies can give any ref guide.
Edited by: Rajkumar Gupta on Jun 2, 2009 11:16 AM -
Urgent : Smart form tables
I have a smartform with main window .Inthis main window i declared one table and it's working fine .i need to add more functionality to smartform i created another table in main window were i declared earlier that place .it's goes to short dump and stops at form functionmodule . it's possible to create similar type of table in main and how is it possle . if another dynamic data collection possble in smartform. help me out .
thanking u,
sureshHi Suresh,
When you create a new table then check for the entries in 'DATA' tab. There you can see that option for internal table is marked. Uncheck it or else give any internal table there.
If you still get any problem then please revert back.
Regards,
Shikha -
Smartfrom vs Adobeform compatibility with MS Outlook 2007
Hi Friends,
Some of you might be aware that there is an issue with rendering (eg: displaying of table formats etc) of smartforms that are sent as an email in MS Outlook 2007.
I am facing this issue with display of a table grid in a smartform. When this smartform is sent as an email, the table grid is not displayed in MS Outlook 2007. Would using an Adobeform instead of Smartform help this issue ?
Any ideas/suggestions to overcome this problem?
Note : We raised an OSS message with SAP and we got the following reply:
"Sadly the problem isn't a SAP-specific problem but a general problem with Microsoft Outlook 2007. Instead of using Internet Explorer as HTML-Renderer Microsoft chose Word 2007 for various reasons. Because of this Outlook 2007 isn't downward-compatible to Outlook 2003 and can't show many of the formerly possible HTML-tags, especially everything within a "form"-Tag. This greatly narrows the possibilities to generate interactive mails."
Thanks-
Harmeet.Hi:
Office 2007 works fine for me on W8.1 including Outlook.
Suggest you either try reinstalling it or find the outlook.exe shortcut in the Office programs folder on your C:\ programs folder and try starting it from there. -
It's very urgent i need help in smartforms
I need your help for smartforms. I created a smartforms in SD for getting quotations. My problem is that when I run da report it is not executing & if i run smartforms it is giving error in da functional module as - In program "/1BCDWB/SAPLSF00000003 ", the following syntax error occurred:
"The data object "I_HEADER" does not have a component called "BNAME"."
and more over i need a code for my my user tht when i execute this form before displaying print or printpreview i should give a popup window asking da user whether to display item code or not then i should get da print or printpreview. when the user needs item code he can print as well if he don't it should not display. this da code i return in se38 editor. In smartforms i wrote code for getting company address etc. I did not write anything in initialization.
source code
*& Application : Sales & Distribution (SD)
*& Description : This report will Print Sales Order Confirmation Using Smartform
*& Transaction Code :
*& Area Menu Code : ZSD
*& Layout : ZSDORDERCONF
*& Dev.Complited On :
REPORT ZSDR0004.
INCLUDE: ZSDI0003.
S U B R O U T I N E S *
FORM ENTRY USING RETURN_CODE TYPE I
US_SCREEN TYPE C.
CLEAR RETCODE.
XSCREEN = US_SCREEN.
PERFORM PROCESSING.
IF RETCODE NE 0.
RETURN_CODE = 1.
ELSE.
RETURN_CODE = 0.
ENDIF.
ENDFORM. "ENTRY
FORM PROCESSING *
FORM PROCESSING.
PERFORM GET_DATA.
CHECK RETCODE = 0.
PERFORM PRINT_DATA.
CHECK RETCODE = 0.
ENDFORM. "PROCESSING
FORM CHECK_REPEAT *
A text is printed, if it is a repeat print for the document. *
FORM CHECK_REPEAT.
CLEAR REPEAT.
SELECT * INTO *NAST FROM NAST WHERE KAPPL = NAST-KAPPL
AND OBJKY = NAST-OBJKY
AND KSCHL = NAST-KSCHL
AND SPRAS = NAST-SPRAS
AND PARNR = NAST-PARNR
AND PARVW = NAST-PARVW
AND NACHA BETWEEN '1' AND '4'.
CHECK *NAST-VSTAT = '1'.
REPEAT = 'X'.
EXIT.
ENDSELECT.
ENDFORM. "CHECK_REPEAT
FORM GET_DATA *
General provision of data for the form *
FORM GET_DATA.
DATA: US_VEDA_VBELN LIKE VEDA-VBELN.
DATA: US_VEDA_POSNR_LOW LIKE VEDA-VPOSN.
DATA: DA_MESS LIKE VBFS OCCURS 0 WITH HEADER LINE.
DATA: DA_SUBRC LIKE SY-SUBRC,
DA_DRAGR LIKE TVAG-DRAGR.
DATA: DA_GANF(1) TYPE C, "Print flag for billing correction
DA_LANF(1) TYPE C. "Print flag for billing correction
CALL FUNCTION 'RV_PRICE_PRINT_GET_MODE'
IMPORTING
E_PRINT_MODE = PRICE_PRINT_MODE.
IF PRICE_PRINT_MODE EQ CHARA.
CALL FUNCTION 'RV_PRICE_PRINT_REFRESH'
TABLES
TKOMV = TKOMV.
ENDIF.
CLEAR KOMK.
CLEAR KOMP.
VBCO3-MANDT = SY-MANDT.
VBCO3-SPRAS = NAST-SPRAS.
VBCO3-VBELN = NAST-OBJKY.
VBCO3-KUNDE = NAST-PARNR.
VBCO3-PARVW = NAST-PARVW.
CALL FUNCTION 'RV_DOCUMENT_PRINT_VIEW'
EXPORTING
COMWA = VBCO3
IMPORTING
KOPF = VBDKA
TABLES
POS = TVBDPA
MESS = DA_MESS
EXCEPTIONS
FEHLER_BEI_DATENBESCHAFFUNG = 1.
IF SY-SUBRC NE 0.
PERFORM PROTOCOL_UPDATE.
RETCODE = 1.
EXIT.
ELSE.
LOOP AT DA_MESS.
SY-MSGID = DA_MESS-MSGID.
SY-MSGNO = DA_MESS-MSGNO.
SY-MSGTY = DA_MESS-MSGTY.
SY-MSGV1 = DA_MESS-MSGV1.
SY-MSGV2 = DA_MESS-MSGV2.
SY-MSGV3 = DA_MESS-MSGV3.
SY-MSGV4 = DA_MESS-MSGV4.
PERFORM PROTOCOL_UPDATE.
ENDLOOP.
ENDIF.
*Get Header Data In I_HEADER Table.
SELECT VBAKVBELN VBAKAUDAT VBAKKUNNR VBAKWAERK
VBAKVKORG VBAKANGDT VBAKBNDDT VBAKVBTYP
VBAKKNUMV VBAKKALSM VBAKNETWR VBAKVKBUR
VBAKBNAME VBKDBSTKD VBKDBSTDK VBKDINCO1
VBKDINCO2 VBKDZTERM
INTO CORRESPONDING FIELDS OF TABLE I_HEADER
FROM VBAK
JOIN VBKD ON VBKDVBELN = VBAKVBELN
WHERE VBAK~VBELN = VBCO3-VBELN.
**Get Address Number For Company
IF NOT I_HEADER[] IS INITIAL.
READ TABLE I_HEADER INDEX 1.
SELECT SINGLE BUKRS ADRNR INTO (COMPCD, ADDCOMP)
FROM TVKO
WHERE VKORG = I_HEADER-VKORG.
ENDIF.
fill address key --> necessary for emails
ADDR_KEY-ADDRNUMBER = VBDKA-ADRNR.
ADDR_KEY-PERSNUMBER = VBDKA-ADRNP.
ADDR_KEY-ADDR_TYPE = VBDKA-ADDRESS_TYPE.
Fetch servicecontract-data and notice-data for head and position.
US_VEDA_VBELN = VBDKA-VBELN.
US_VEDA_POSNR_LOW = POSNR_LOW.
CALL FUNCTION 'SD_VEDA_GET_PRINT_DATA'
EXPORTING
I_DOCUMENT_NUMBER = US_VEDA_VBELN
I_LANGUAGE = SY-LANGU
I_POSNR_LOW = US_VEDA_POSNR_LOW
TABLES
PRINT_DATA_POS = TKOMSERVP
PRINT_DATA_HEAD = TKOMSERVH
PRINT_NOTICE_POS = TKOMSERVPN
PRINT_NOTICE_HEAD = TKOMSERVHN.
PERFORM GET_CONTROLL_DATA.
PERFORM SENDER.
PERFORM CHECK_REPEAT.
LOOP AT TVBDPA.
VBDPA = TVBDPA.
IF VBDPA-DRAGR EQ SPACE. "Print rejected item?
IF VBDPA-POSNR_NEU NE SPACE. "Item
PERFORM GET_ITEM_SERIALS.
PERFORM GET_ITEM_CHARACTERISTICS.
PERFORM GET_ITEM_BILLING_SCHEDULES.
PERFORM GET_ITEM_PRICES.
PERFORM GET_ITEM_ADDIS.
ENDIF.
ENDIF.
ENDLOOP.
ENDFORM. "GET_DATA
FORM GET_ITEM_BILLING_SCHEDULES *
In this routine the billing schedules are fetched from the *
database. *
FORM GET_ITEM_BILLING_SCHEDULES.
REFRESH TFPLTDR.
CHECK NOT VBDPA-FPLNR IS INITIAL.
CALL FUNCTION 'BILLING_SCHED_PRINTVIEW_READ'
EXPORTING
I_FPLNR = VBDPA-FPLNR
I_LANGUAGE = NAST-SPRAS
I_VBELN = VBDKA-VBELN
TABLES
ZFPLTDR = TFPLTDR.
ENDFORM. "GET_ITEM_BILLING_SCHEDULES
*& FORM GET_ITEM_ADDIS
Additionals data are fetched from database
FORM GET_ITEM_ADDIS.
CLEAR: TADDI_PRINT.
CALL FUNCTION 'WTAD_ADDIS_IN_SO_PRINT'
EXPORTING
FI_VBELN = VBDKA-VBELN
FI_POSNR = VBDPA-POSNR
FI_LANGUAGE = SY-LANGU
TABLES
FET_ADDIS_IN_SO_PRINT = TADDI_PRINT
EXCEPTIONS
ADDIS_NOT_ACTIVE = 1
NO_ADDIS_FOR_SO_ITEM = 2
OTHERS = 3.
ENDFORM. " GET_ITEM_ADDIS
FORM GET_ITEM_CHARACTERISTICS *
In this routine the configuration data item is fetched from *
the database. *
FORM GET_ITEM_CHARACTERISTICS.
DATA DA_T_CABN LIKE CABN OCCURS 10 WITH HEADER LINE.
DATA: BEGIN OF DA_KEY,
MANDT LIKE CABN-MANDT,
ATINN LIKE CABN-ATINN,
END OF DA_KEY.
REFRESH TKOMCON.
CHECK NOT VBDPA-CUOBJ IS INITIAL AND
VBDPA-ATTYP NE VAR_TYP.
CALL FUNCTION 'VC_I_GET_CONFIGURATION'
EXPORTING
INSTANCE = VBDPA-CUOBJ
LANGUAGE = NAST-SPRAS
PRINT_SALES = CHARX
TABLES
CONFIGURATION = TKOMCON
EXCEPTIONS
OTHERS = 4.
RANGES : DA_IN_CABN FOR DA_T_CABN-ATINN.
Beschreibung der Merkmale wegen Objektmerkmalen auf sdcom-vkond holen
CLEAR DA_IN_CABN. REFRESH DA_IN_CABN.
LOOP AT TKOMCON.
DA_IN_CABN-OPTION = 'EQ'.
DA_IN_CABN-SIGN = 'I'.
DA_IN_CABN-LOW = TKOMCON-ATINN.
APPEND DA_IN_CABN.
ENDLOOP.
CLEAR DA_T_CABN. REFRESH DA_T_CABN.
CALL FUNCTION 'CLSE_SELECT_CABN'
EXPORTING
KEY_DATE = SY-DATUM
BYPASSING_BUFFER = ' '
WITH_PREPARED_PATTERN = ' '
I_AENNR = ' '
IMPORTING
AMBIGUOUS_OBJ_CHARACTERISTIC =
TABLES
IN_CABN = DA_IN_CABN
T_CABN = DA_T_CABN
EXCEPTIONS
NO_ENTRY_FOUND = 1
OTHERS = 2.
Preisfindungsmerkmale / Merkmale auf VCSD_UPDATE herausnehmen
SORT DA_T_CABN.
LOOP AT TKOMCON.
DA_KEY-MANDT = SY-MANDT.
DA_KEY-ATINN = TKOMCON-ATINN.
READ TABLE DA_T_CABN WITH KEY DA_KEY BINARY SEARCH.
IF SY-SUBRC <> 0 OR
( ( DA_T_CABN-ATTAB = 'SDCOM' AND
DA_T_CABN-ATFEL = 'VKOND' ) OR
( DA_T_CABN-ATTAB = 'VCSD_UPDATE' ) ) .
DELETE TKOMCON.
ENDIF.
ENDLOOP.
ENDFORM. "GET_ITEM_CHARACTERISTICS
FORM GET_ITEM_PRICES *
In this routine the price data for the item is fetched from *
the database. *
FORM GET_ITEM_PRICES.
CLEAR: KOMP,
TKOMV.
IF KOMK-KNUMV NE VBDKA-KNUMV OR
KOMK-KNUMV IS INITIAL.
CLEAR KOMK.
KOMK-MANDT = SY-MANDT.
KOMK-KALSM = VBDKA-KALSM.
KOMK-KAPPL = PR_KAPPL.
KOMK-WAERK = VBDKA-WAERK.
KOMK-KNUMV = VBDKA-KNUMV.
KOMK-KNUMA = VBDKA-KNUMA.
KOMK-VBTYP = VBDKA-VBTYP.
KOMK-LAND1 = VBDKA-LAND1.
KOMK-VKORG = VBDKA-VKORG.
KOMK-VTWEG = VBDKA-VTWEG.
KOMK-SPART = VBDKA-SPART.
KOMK-BUKRS = VBDKA-BUKRS_VF.
KOMK-HWAER = VBDKA-WAERS.
KOMK-PRSDT = VBDKA-ERDAT.
KOMK-KURST = VBDKA-KURST.
KOMK-KURRF = VBDKA-KURRF.
KOMK-KURRF_DAT = VBDKA-KURRF_DAT.
ENDIF.
KOMP-KPOSN = VBDPA-POSNR.
KOMP-KURSK = VBDPA-KURSK.
KOMP-KURSK_DAT = VBDPA-KURSK_DAT.
if vbdka-vbtyp ca 'HKNOT6'.
if vbdpa-shkzg ca ' A'.
komp-shkzg = 'X'.
endif.
else.
if vbdpa-shkzg ca 'BX'.
komp-shkzg = 'X'.
endif.
endif.
IF PRICE_PRINT_MODE EQ CHARA.
CALL FUNCTION 'RV_PRICE_PRINT_ITEM'
EXPORTING
COMM_HEAD_I = KOMK
COMM_ITEM_I = KOMP
LANGUAGE = NAST-SPRAS
IMPORTING
COMM_HEAD_E = KOMK
COMM_ITEM_E = KOMP
TABLES
TKOMV = TKOMV
TKOMVD = TKOMVD.
ELSE.
CALL FUNCTION 'RV_PRICE_PRINT_ITEM_BUFFER'
EXPORTING
COMM_HEAD_I = KOMK
COMM_ITEM_I = KOMP
LANGUAGE = NAST-SPRAS
IMPORTING
COMM_HEAD_E = KOMK
COMM_ITEM_E = KOMP
TABLES
TKOMV = TKOMV
TKOMVD = TKOMVD.
ENDIF.
ENDFORM. "GET_ITEM_PRICES
FORM GET_HEADER_PRICES *
In this routine the price data for the header is fetched from *
the database. *
FORM GET_HEADER_PRICES.
LOOP AT TVBDPA.
CALL FUNCTION 'SD_TAX_CODE_MAINTAIN'
EXPORTING
KEY_KNUMV = VBDKA-KNUMV
KEY_KPOSN = TVBDPA-POSNR
I_APPLICATION = ' '
I_PRICING_PROCEDURE = VBDKA-KALSM
TABLES
XKOMV = TKOMV.
ENDLOOP.
IF PRICE_PRINT_MODE EQ CHARA.
CALL FUNCTION 'RV_PRICE_PRINT_HEAD'
EXPORTING
COMM_HEAD_I = KOMK
LANGUAGE = NAST-SPRAS
IMPORTING
COMM_HEAD_E = KOMK
TABLES
TKOMV = TKOMV
TKOMVD = TKOMVD.
ELSE.
CALL FUNCTION 'RV_PRICE_PRINT_HEAD_BUFFER'
EXPORTING
COMM_HEAD_I = KOMK
LANGUAGE = NAST-SPRAS
IMPORTING
COMM_HEAD_E = KOMK
TABLES
TKOMV = TKOMV
TKOMVD = TKOMVD.
ENDIF.
ENDFORM. "GET_HEADER_PRICES
FORM PRINT_DATA *
Print Quotation *
FORM PRINT_DATA.
DATA: ls_control TYPE ssfctrlop.
data: OUTPUT_OPTIONS TYPE SSFCOMPOP,cf_retcode type sy-subrc.
DATA: ls_print_data_to_read TYPE lbbil_print_data_to_read.
DATA: ls_addr_key LIKE addr_key.
DATA: ls_dlv-land LIKE vbrk-land1.
DATA: ls_job_info TYPE ssfcrescl.
DATA: ls_control_param TYPE ssfctrlop.
DATA: ls_composer_param TYPE ssfcompop.
DATA: ls_recipient TYPE swotobjid.
DATA: ls_sender TYPE swotobjid.
DATA: NAST_ANZAL LIKE NAST-ANZAL. "Number of outputs (Orig. + Cop.)
DATA: NAST_TDARMOD LIKE NAST-TDARMOD. "Archiving only one time
DATA: ls_bil_invoice TYPE lbbil_invoice.
SELECT SINGLE SFORM INTO LF_FORMNAME
FROM TNAPR
WHERE KSCHL = NAST-KSCHL
AND NACHA = NAST-NACHA.
*IF NAST-KSCHL = 'ZORD'.
lf_formname = 'ZSDORDERCONF'.
*ELSEIF NAST-KSCHL = 'ZOR1'.
lf_formname = 'ZSDORDERCONF'.
*ELSEIF NAST-KSCHL = 'ZOR2'.
lf_formname = 'ZCSORDERCONF'.
ENDIF.
determine smartform function module for invoice
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = lf_formname
IMPORTING
fm_name = lf_fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
ENDIF.
READ TABLE I_HEADER INDEX 1.
ls_controL-no_dialog = 'X'.
if sy-ucomm = 'VIEW'.
LS_CONTROL-PREVIEW = 'X'.
endif.
CALL FUNCTION LF_FM_NAME
EXPORTING
control_parameters = ls_control
OUTPUT_OPTIONS = OUTPUT_OPTIONS
SO_VBELN = I_HEADER-VBELN
SO_AUDAT = I_HEADER-AUDAT
SO_REPEAT = REPEAT
SO_TYPE = I_HEADER-VBTYP
SO_CADD = ADDCOMP
SO_CCODE = COMPCD
TABLES
I_HEADER = I_HEADER
TKOMV = TKOMV
I_ITEM = TVBDPA
I_XDATA = I_XDATA
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
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. "PRINT_DATA
FORM PROTOCOL_UPDATE *
The messages are collected for the processing protocol. *
FORM PROTOCOL_UPDATE.
CHECK XSCREEN = SPACE.
CALL FUNCTION 'NAST_PROTOCOL_UPDATE'
EXPORTING
MSG_ARBGB = SYST-MSGID
MSG_NR = SYST-MSGNO
MSG_TY = SYST-MSGTY
MSG_V1 = SYST-MSGV1
MSG_V2 = SYST-MSGV2
MSG_V3 = SYST-MSGV3
MSG_V4 = SYST-MSGV4
EXCEPTIONS
OTHERS = 1.
ENDFORM. "PROTOCOL_UPDATE
FORM SENDER *
This routine determines the address of the sender (Table VKO) *
FORM SENDER.
SELECT SINGLE * FROM TVKO WHERE VKORG = VBDKA-VKORG.
IF SY-SUBRC NE 0.
SYST-MSGID = 'VN'.
SYST-MSGNO = '203'.
SYST-MSGTY = 'E'.
SYST-MSGV1 = 'TVKO'.
SYST-MSGV2 = SYST-SUBRC.
PERFORM PROTOCOL_UPDATE.
EXIT.
ENDIF.
CLEAR GV_FB_ADDR_GET_SELECTION.
GV_FB_ADDR_GET_SELECTION-ADDRNUMBER = TVKO-ADRNR. "SADR40A
CALL FUNCTION 'ADDR_GET'
EXPORTING
ADDRESS_SELECTION = GV_FB_ADDR_GET_SELECTION
ADDRESS_GROUP = 'CA01'
IMPORTING
SADR = SADR
EXCEPTIONS
OTHERS = 01.
IF SY-SUBRC NE 0.
CLEAR SADR.
ENDIF. "SADR40A
VBDKA-SLAND = SADR-LAND1.
IF SY-SUBRC NE 0.
SYST-MSGID = 'VN'.
SYST-MSGNO = '203'.
SYST-MSGTY = 'E'.
SYST-MSGV1 = 'SADR'.
SYST-MSGV2 = SYST-SUBRC.
PERFORM PROTOCOL_UPDATE.
ENDIF.
SELECT SINGLE * FROM TVBUR WHERE VKBUR = VBDKA-VKBUR.
IF SY-SUBRC NE 0.
SYST-MSGID = 'VN'.
SYST-MSGNO = '203'.
SYST-MSGTY = 'E'.
SYST-MSGV1 = 'TVBUR'.
SYST-MSGV2 = SYST-SUBRC.
PERFORM PROTOCOL_UPDATE.
ENDIF.
ENDFORM. "SENDER
*& Form GET_ITEM_SERIALS
This routine give back the serialnumbers of salesdocument *
position. The numbers are processed as print-lines in the *
table KOMSER_PRINT. *
--> US_VBELN Salesdocument
--> US_POSNR Position of the salesdocument
FORM GET_ITEM_SERIALS.
DATA: KEY_DATA LIKE RSEROB,
SERNOS LIKE RSEROB OCCURS 0 WITH HEADER LINE.
KEY_DATA-TASER = 'SER02'.
KEY_DATA-SDAUFNR = VBDKA-VBELN.
KEY_DATA-POSNR = VBDPA-POSNR.
IF KEY_DATA-SDAUFNR IS INITIAL AND NOT
KEY_DATA-POSNR IS INITIAL.
beim Anlegen ist Belegnummer leer - deshalb Dummy-Belegnummer
KEY_DATA-SDAUFNR = CHAR$.
ENDIF.
Read the Serialnumbers of a Position.
REFRESH: TKOMSER,
TKOMSER_PRINT.
CALL FUNCTION 'GET_SERNOS_OF_DOCUMENT'
EXPORTING
KEY_DATA = KEY_DATA
TABLES
SERNOS = SERNOS
EXCEPTIONS
KEY_PARAMETER_ERROR = 1
NO_SUPPORTED_ACCESS = 2
NO_DATA_FOUND = 3
OTHERS = 4.
IF SY-SUBRC NE 0 AND
SY-SUBRC NE 3.
PERFORM PROTOCOL_UPDATE.
ENDIF.
CHECK SY-SUBRC EQ 0.
Serialnummern übergeben
TKOMSER-VBELN = SERNOS-SDAUFNR.
TKOMSER-POSNR = SERNOS-POSNR.
LOOP AT SERNOS.
TKOMSER-SERNR = SERNOS-SERNR.
APPEND TKOMSER.
ENDLOOP.
Process the stringtable for Printing.
CALL FUNCTION 'PROCESS_SERIALS_FOR_PRINT'
EXPORTING
I_BOUNDARY_LEFT = '(_'
I_BOUNDARY_RIGHT = '_)'
I_SEP_CHAR_STRINGS = ',_'
I_SEP_CHAR_INTERVAL = '_-_'
I_USE_INTERVAL = 'X'
I_BOUNDARY_METHOD = 'C'
I_LINE_LENGTH = 50
I_NO_ZERO = 'X'
I_ALPHABET = SY-ABCDE
I_DIGITS = '0123456789'
I_SPECIAL_CHARS = '-'
I_WITH_SECOND_DIGIT = ' '
TABLES
SERIALS = TKOMSER
SERIALS_PRINT = TKOMSER_PRINT
EXCEPTIONS
BOUNDARY_MISSING = 01
INTERVAL_SEPARATION_MISSING = 02
LENGTH_TO_SMALL = 03
INTERNAL_ERROR = 04
WRONG_METHOD = 05
WRONG_SERIAL = 06
TWO_EQUAL_SERIALS = 07
SERIAL_WITH_WRONG_CHAR = 08
SERIAL_SEPARATION_MISSING = 09.
IF SY-SUBRC NE 0.
PERFORM PROTOCOL_UPDATE.
ENDIF.
ENDFORM. " GET_ITEM_SERIALS
*eject
*& Form GET_CONTROLL_DATA
Checks if servicedata for the header exists. *
Checks if servicedata for the position exists. *
Checks if noticedata for the header exists. *
Checks if noticedata for the position exists. *
FORM GET_CONTROLL_DATA.
DATA: LINES TYPE I.
Exists servicedata for the header?
DESCRIBE TABLE TKOMSERVH LINES LINES.
IF LINES GT 0.
STEU-VDKEX = 'X'.
ENDIF.
Exists servicedata for the position?
DESCRIBE TABLE TKOMSERVP LINES LINES.
IF LINES GT 0.
STEU-VDPEX = 'X'.
ENDIF.
Exists noticedata for the header?
DESCRIBE TABLE TKOMSERVHN LINES LINES.
IF LINES GT 0.
STEU-KBKEX = 'X'.
ENDIF.
Exists noticedata for the position?
DESCRIBE TABLE TKOMSERVPN LINES LINES.
IF LINES GT 0.
STEU-KBPEX = 'X'.
ENDIF.
ENDFORM. " GET_CONTROLL_DATA
*eject
*& Form get_fax_land
text
-->P_NAST_TLAND text
form get_fax_land using p_nast_land like nast-tland.
DATA L_land like nast-tland .
clear L_land.
IF NOT addr_key-addrnumber IS INITIAL.
CALL FUNCTION 'WFMC_FAXNUMBER_FOR_ADDRESS'
EXPORTING
adrnr = addr_key-addrnumber
IMPORTING
tland = L_land
EXCEPTIONS
addr_not_exist = 1
OTHERS = 2.
IF sy-subrc = 0 AND NOT L_land IS INITIAL.
p_nast_land = L_land.
ENDIF.
ENDIF.
endform. " get_fax_land
*& Form get_data1
text
-->P_LS_PRINT_DATA_TO_READ text
<--P_LS_ADDR_KEY text
<--P_LS_DLV_LAND text
<--P_LS_BIL_INVOICE text
<--P_CF_RETCODE text
FORM get_data1
USING IS_PRINT_DATA_TO_READ TYPE LBBIL_PRINT_DATA_TO_READ
CHANGING CS_ADDR_KEY LIKE ADDR_KEY
CS_DLV-LAND LIKE VBRK-LAND1
CS_BIL_INVOICE TYPE LBBIL_INVOICE
CF_RETCODE.
IF NAST-OBJKY+10 NE SPACE.
NAST-OBJKY = NAST-OBJKY+16(10).
ELSE.
NAST-OBJKY = NAST-OBJKY.
ENDIF.
read print data
CALL FUNCTION 'LB_BIL_INV_OUTP_READ_PRTDATA'
EXPORTING
IF_BIL_NUMBER = NAST-OBJKY
IF_PARVW = NAST-PARVW
IF_PARNR = NAST-PARNR
IF_LANGUAGE = NAST-SPRAS
IS_PRINT_DATA_TO_READ = IS_PRINT_DATA_TO_READ
IMPORTING
ES_BIL_INVOICE = CS_BIL_INVOICE
EXCEPTIONS
RECORDS_NOT_FOUND = 1
RECORDS_NOT_REQUESTED = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
error handling
CF_RETCODE = SY-SUBRC.
PERFORM PROTOCOL_UPDATE.
ENDIF.
get nast partner adress for communication strategy
PERFORM GET_ADDR_KEY USING CS_BIL_INVOICE-HD_ADR
CHANGING CS_ADDR_KEY.
get delivery land
PERFORM GET_DLV-LAND USING CS_BIL_INVOICE-HD_GEN
CHANGING CS_DLV-LAND.
ENDFORM. " get_data1
*& Form GET_ADDR_KEY
text
-->P_CS_BIL_INVOICE_HD_ADR text
<--P_CS_ADDR_KEY text
FORM GET_ADDR_KEY USING IT_HD_ADR TYPE LBBIL_INVOICE-HD_ADR
CHANGING CS_ADDR_KEY LIKE ADDR_KEY.
FIELD-SYMBOLS -ADDRESS_TYPE.
ENDIF.
ENDFORM. " GET_ADDR_KEY
*& Form GET_DLV-LAND
text
-->P_CS_BIL_INVOICE_HD_GEN text
<--P_CS_DLV_LAND text
FORM GET_DLV-LAND USING IT_HD_GEN TYPE LBBIL_INVOICE-HD_GEN
CHANGING CS_DLV-LAND LIKE VBRK-LAND1.
CS_DLV-LAND = IT_HD_GEN-DLV_LAND.
ENDFORM. " GET_DLV-LAND
*& Form set_print_data_to_read
text
-->P_LF_FORMNAME text
<--P_LS_PRINT_DATA_TO_READ text
<--P_CF_RETCODE text
FORM set_print_data_to_read USING IF_FORMNAME LIKE TNAPR-SFORM
CHANGING CS_PRINT_DATA_TO_READ TYPE LBBIL_PRINT_DATA_TO_READ
CF_RETCODE.
FIELD-SYMBOLS: TYPE XFELD.
DATA: LT_FIELDLIST TYPE TSFFIELDS.
set print data requirements
DO.
ASSIGN COMPONENT SY-INDEX OF STRUCTURE
CS_PRINT_DATA_TO_READ TO = 'X'.
ENDDO.
CALL FUNCTION 'SSF_FIELD_LIST'
EXPORTING
FORMNAME = IF_FORMNAME
VARIANT = ' '
IMPORTING
FIELDLIST = LT_FIELDLIST
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
error handling
CF_RETCODE = SY-SUBRC.
PERFORM PROTOCOL_UPDATE.
ENDIF.
ENDFORM. " set_print_data_to_read
*& Form set_print_param
text
-->P_LS_ADDR_KEY text
-->P_LS_DLV_LAND text
<--P_LS_CONTROL_PARAM text
<--P_LS_COMPOSER_PARAM text
<--P_LS_RECIPIENT text
<--P_LS_SENDER text
<--P_CF_RETCODE text
FORM set_print_param using IS_ADDR_KEY LIKE ADDR_KEY
IS_DLV-LAND LIKE VBRK-LAND1
CHANGING CS_CONTROL_PARAM TYPE SSFCTRLOP
CS_COMPOSER_PARAM TYPE SSFCOMPOP
CS_RECIPIENT TYPE SWOTOBJID
CS_SENDER TYPE SWOTOBJID
CF_RETCODE TYPE SY-SUBRC.
DATA: LS_ITCPO TYPE ITCPO.
DATA: LF_REPID TYPE SY-REPID.
DATA: LF_DEVICE TYPE TDDEVICE.
DATA: LS_RECIPIENT TYPE SWOTOBJID.
DATA: LS_SENDER TYPE SWOTOBJID.
LF_REPID = SY-REPID.
CALL FUNCTION 'WFMC_PREPARE_SMART_FORM'
EXPORTING
PI_NAST = NAST
PI_COUNTRY = IS_DLV-LAND
PI_ADDR_KEY = IS_ADDR_KEY
PI_REPID = LF_REPID
PI_SCREEN = XSCREEN
IMPORTING
PE_RETURNCODE = CF_RETCODE
PE_ITCPO = LS_ITCPO
PE_DEVICE = LF_DEVICE
PE_RECIPIENT = CS_RECIPIENT
PE_SENDER = CS_SENDER.
IF CF_RETCODE = 0.
MOVE-CORRESPONDING LS_ITCPO TO CS_COMPOSER_PARAM.
CS_CONTROL_PARAM-NO_OPEN
CS_CONTROL_PARAM-NO_CLOSE
CS_CONTROL_PARAM-DEVICE = LF_DEVICE.
CS_CONTROL_PARAM-NO_DIALOG = 'X'.
CS_CONTROL_PARAM-PREVIEW = XSCREEN.
CS_CONTROL_PARAM-GETOTF = LS_ITCPO-TDGETOTF.
CS_CONTROL_PARAM-LANGU = NAST-SPRAS.
CS_CONTROL_PARAM-REPLANGU1
CS_CONTROL_PARAM-REPLANGU2
CS_CONTROL_PARAM-REPLANGU3
CS_CONTROL_PARAM-STARTPAGE
ENDIF.
ENDFORM. " set_print_param
*& Form add_smfrm_prot
text
--> p1 text
<-- p2 text
FORM add_smfrm_prot .
DATA: LT_ERRORTAB TYPE TSFERROR.
DATA: LF_MSGNR TYPE SY-MSGNO.
FIELD-SYMBOLS: TYPE LINE OF TSFERROR.
get smart form protocoll
CALL FUNCTION 'SSF_READ_ERRORS'
IMPORTING
ERRORTAB = LT_ERRORTAB.
add smartform protocoll to nast protocoll
LOOP AT LT_ERRORTAB ASSIGNING .
CLEAR LF_MSGNR.
LF_MSGNR = <FS_ERRORTAB>-ERRNUMBER.
CALL FUNCTION 'NAST_PROTOCOL_UPDATE'
EXPORTING
MSG_ARBGB = -MSGID
MSG_NR = LF_MSGNR
MSG_NR = -MSGV4
EXCEPTIONS
OTHERS = 1.
ENDLOOP.
ENDFORM. " add_smfrm_prot
*& Form protocol_update_spool
text
-->P_1115 text
-->P_LS_SPOOLID text
-->P_SPACE text
-->P_SPACE text
-->P_SPACE text
FORM protocol_update_spool USING SYST_MSGNO
P_LS_SPOOLID
P_SPACE1
P_SPACE2
P_SPACE3.
syst-msgid = 'VN'.
syst-msgno = syst_msgno.
syst-msgv1 = p_ls_spoolid.
CONDENSE syst-msgv1.
CHECK xscreen = space.
CALL FUNCTION 'NAST_PROTOCOL_UPDATE'
EXPORTING
msg_arbgb = syst-msgid
msg_nr = syst-msgno
msg_ty = syst-msgty
msg_v1 = syst-msgv1
msg_v2 = p_space1
msg_v3 = p_space2
msg_v4 = p_space3
EXCEPTIONS
OTHERS = 1.
ENDFORM. " protocol_update_spool
This is Include ZSDI0003
*& Include ZSDI0003
TABLES: KOMK, "Communicationarea for conditions
KOMP, "Communicationarea for conditions
KOMVD, "Communicationarea for conditions
VBCO3, "Communicationarea for view
VBDKA, "Headerview
VBDPA, "Itemview
VBDPAU, "Subitemnumbers
CONF_OUT, "Configuration data
SADR, "Addresses
TVAG, "Reason for rejection
VEDKA, "Servicecontract head data
VEDPA, "Servicecontract position data
VEDKN, "Servicecontract head notice data
VEDPN, "Servicecontract pos. notice data
RISERLS, "Serialnumbers
KOMSER, "Serialnumbers for print
TVBUR, "Sales office
TVKO, "Sales organisation
ADRS, "Communicationarea for Address
FPLTDR, "billing schedules
WTAD_ADDIS_IN_SO_PRINT, "additional
WTAD_BUYING_PRINT_EXTRA_TEXT, "texts belonging to additional
VBAK, "Sales Document Header
VBAP, "Sales Document Item
VBPA, "Sales Document: Partner
T001, "Company codes
MAST, "Material to BOM Link
STKO. "BOM Header
INCLUDE RVADTABL.
INCLUDE RVDIREKT.
INCLUDE VEDADATA.
data for access to central address maintenance
INCLUDE SDZAVDAT.
TYPE-POOLS: ADDI.
DATA PRICE_PRINT_MODE(1) TYPE C. "Print-mode
DATA: RETCODE LIKE SY-SUBRC. "Returncode
DATA: REPEAT(1) TYPE C.
DATA: XSCREEN(1) TYPE C. "Output on printer or screen
DATA: BEGIN OF STEU, "Controldata for output
VDKEX(1) TYPE C,
VDPEX(1) TYPE C,
KBKEX(1) TYPE C,
KBPEX(1) TYPE C,
1) you shouldn't have to do anything with the properties file written for a specific Locale.
2) check this out: http://java.sun.com/j2se/1.4/docs/guide/intl/encoding.doc.html
3) BIG5 is BIG5 everywhere.
4) don't know about this one
5,6,7) If you have Windows 98 Chinese Edition, you can probably switch back and forth between English and Chinese -- just put the Chinese characters in a string much like the normal characters. Otherwise, you'll have to enter the Unicode char.
V.V. -
Need help in conversion of pdf file to itab and d details abt SMARTFORMS
hello all
how can i retrieve data from pdf file (instead of a txt format) to an internal table for an BDC application .
anyone of you please help me in SMARTFORMS .Hi,
If you want to conver report data in pdf format then you have to made some changes in programe and some setting done by abaper in the programe.
Regards,
Anil -
Hi Friends,
I am working on a smartform. This is a modification to the existing form. In the Smartform i have 3 pages. For page2, there are 3 scenarios. There is a custom table (Say gt_customtable). It contains Document ID field (DOCID), and for each document id, it has a indicator field (Say indicator = E / S). E = Emergency order, and S = Stock order.
When the indicator is E for the docid's, then Scenario 1 should be printed, that is Emergency layout should be printed.
When the indicator is S for the docid's, then Scenario 2 should be printed, that is Stock layout should be printed.
When the indicator is both E & S, then Scenario 3 should be printed, that is Emergency layout should be printed first, and then Stock layout should be printed.
There is an internal table called gt_page2, which has both the Header data, and Line items data.
The header data is same for all the scenarios, and need not be changed. But coming to the Line items data, emergency layout is different from stock layout.
How do i approach this situation. Can you please help me out here.
Thanks,
NikhilHi Suneel,
Thank you very much for replying. Actually Page3 has nothing to do with page2 here. The Issue is Page2 has 3 scenarios. The layout for each of 3 scenarios is different. Indicator is E for Page2-scenario 1 layout, and S for Page2-scenario 2 layout. But when the indicator is both E, and S....then Scenario1 is printed first, then scenario 2.
Do we need to create 2 tables, one for each scenario, each with different layout. Or create a flag, and depending on this flag, can we play with text elements in the layout by giving them in the conditions tab.
Thanks,
Nikhil -
HI
in my company in MM module MM people generating Purchase Order
So we r using smartform for Purchase order.
actually problem is company is having another 3 Group compnies.
each and every company want different layout and formating for each page
in print layout. .
so how can i do it by using single smartform .
or is there any way to do it.
please help me .
thanks in advancedhi Shukla,
assume u wnt to design smartform for 3 companycodes.. but each them want different output format.
u can achive this by using condition tab..in each of the node...
or another way is inside the page>create 3 FOLDERS> for this give the condition of the company code are whtever u want to differentiate....
it mean at purticular time system will trigger only one folder based the complay code you have.
In this folder insert the node u require to print for the purticular company code.
by above u r first problem will be solved.
another problem is... somebody wants the page in horizantal(portrait) and sombody wants it in vertical(Landscape)... if it is for the u have to include more pages in you form.. use the conditions..to ensure it should tribgger only for the required company code.
Please Close this thread.. when u r problem is solved
Reward if Helpful
Regards
Naresh Reddy K
Maybe you are looking for
-
No more Quicktime on Internet Explorer PCs
When any PC with Internet Explorer reaches any page with Quicktime it will show the following message: An Error occured in an plugin contained on this page. This plugin did not initialize properly. You get this message for example when you reach the
-
Weird chart shifting problem?
I'm having a problem that's easy to reproduce. Create a pie chart on a blank slide (the default data will work fine). In the inspector move the Labels so they are outside of the pie chart -- around the perimeter. Now set the chart so the build is by
-
Create FB03 attachments to external Website
Hi Gurus, I have a requirement where my client wants to use FB03 create attachment functionality but at the same time, they don't want the attachments to store in SAP Sood table or related ones for there may be a time when the tables will be clogged.
-
AVIS selection parameter - wrong result in VL31N list
Hello! I crete inbound delivery from VL31N using order list. Default selection parameter is "AVIS". Result list for delivery creation contains partialy delivered orders with "delivery completed" indicator is set. When I try to create delivery for the
-
Problems with Exporting Tabs - Component Export
Hi, i'm having the following problem. i have two applications in the same workspace. application 630 and 640. now i try to export the tabs from app 640 in "Component Export". in the export file i search for wwv_flow.g_flow_id := nvl(wwv_flow_applicat