sapscript--> PDF
Cu programul RSTXPDFT4, dai numarul cererii de spool, si specifici calea in care sa faca download la formularul .pdf.
Cu programul RSTXPDFT4, dai numarul cererii de spool, si specifici calea in care sa faca download la formularul .pdf.
Cu SE73 poti intretine fonturile instalate, si poti incarca un anumit font.
Pentru SMARTFORMS, programelul din spatele formularului se compleateaza cam asa:
Cu SE78 aduci imaginile pe care vrei sa le incluzi in SmartForms pe serverul de documente al sistemului SAP (BSD), in format TIF.Imaginile pot fi logo-uri sau pretiparite scanate si folosite ca background.
report z_test1.
*---------program pentru smartform ZBSEG
nodes: bkpf, bseg.
types: begin of t_inserare,
bukrs like bkpf-bukrs,
belnr like bkpf-belnr,
gjahr like bkpf-gjahr,
buzei like bseg-buzei,
blart like bkpf-blart,
wrbtr like bseg-wrbtr,
end of t_inserare.
data: inserare type standard table of t_inserare with header line,
wa_inserare type t_inserare.
data : fm_name type rs38l_fnam.
get bkpf.
check br_bukrs.
check br_belnr.
check br_gjahr.
check br_blart.
get bseg.
inserare-bukrs = bkpf-bukrs.
inserare-belnr = bkpf-belnr.
inserare-gjahr = bkpf-gjahr.
inserare-buzei = bseg-buzei.
inserare-blart = bkpf-blart.
inserare-wrbtr = bseg-wrbtr.
append inserare.
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = 'ZBSEG'
* 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.
endif.
*ca sa afli numele FM care sta in spatele smartform-ului trebuie sa-l activezi si cauta in meniu, o chestie de genul View Function Module
call function '/1BCDWB/SF00000007'
* EXPORTING
* ARCHIVE_INDEX =
* ARCHIVE_INDEX_TAB =
* ARCHIVE_PARAMETERS =
* CONTROL_PARAMETERS =
* MAIL_APPL_OBJ =
* MAIL_RECIPIENT =
* MAIL_SENDER =
* OUTPUT_OPTIONS =
* USER_SETTINGS = 'X'
* IMPORTING
* DOCUMENT_OUTPUT_INFO =
* JOB_OUTPUT_INFO =
* JOB_OUTPUT_OPTIONS =
tables
inserare = inserare
* 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.
SE03---SCHIMBARE CLASA DE DEZV SI ALTE ATTRIBUTES OF OBJECTS
STMS---ADUC CERERILE IN TEST
ST22---VEZI SHORT-DUMPS
SM35---BATCH INPUT SESSION PROCESARE
SM37---JOB-URI
SMOD----USER-EXIT-URILE
SE93---INTRETINERE CODURI TRANZACTII
SM04---LISTA UTILIZATORI CU TRANZACTII DESCHISE LA MOM. RESPECTIV
SE39---COMPARA DOUA VERSIUNI DE PROGRAM, CHIAR SI REMOTE COMPARISON
SE71----SAPSCRIPT FORMS
DWDM----CONTROALE ENJOY SAP
SM02---MESAJE SISTEM
/bend --Cancel a batch input foreground process
concatenate 'Prg. a mai fost rulat de' zcorectii_nc-uname ' '
' la ' zcorectii_nc-datum into fraza.
if sy-batch is initial.
*daca a mai fost rulat--------------
call function 'ZPOPUP_TO_GET_ONE_VALUE'
exporting
textline1 =
fraza
textline2 =
'Daca nu sinteti sigur RENUNTATI'
textline3 = 'Introduceti parola de acces !'
titel = 'Info'
valuelength = '10'
importing
* ANSWER =
value1 = value.
* EXCEPTIONS
* TITEL_TOO_LONG = 1
* OTHERS = 2
if not value is initial.
if value <> sy-uname+0(3).
message e999(zbc) with 'Parola incorecta'.
ELSE.
PERFORM rulare_ulterioara.
ENDIF.
else.
message e999(zbc) with 'Parola incorecta'.
endif.
else.
PERFORM rulare_ulterioara.
endif.
Unde zpopup_to_get_one_value este definit ca :
FUNCTION ZPOPUP_TO_GET_ONE_VALUE.
*"----------------------------------------------------------------------
*"*"Local interface:
*" IMPORTING
*" VALUE(TEXTLINE1)
*" VALUE(TEXTLINE2) DEFAULT SPACE
*" VALUE(TEXTLINE3) DEFAULT SPACE
*" VALUE(TITEL)
*" VALUE(VALUELENGTH)
*" EXPORTING
*" VALUE(ANSWER)
*" VALUE(VALUE1) LIKE SPOP-VARVALUE1
*" EXCEPTIONS
*" TITEL_TOO_LONG
*"----------------------------------------------------------------------
* CALL FUNCTION 'STRING_CENTER'
* EXPORTING STRING = TITEL
* IMPORTING CSTRING = SPOP-TITEL
* EXCEPTIONS TOO_SMALL 1.
* IF SY-SUBRC = 1.
* RAISE TITEL_TOO_LONG.
* ENDIF.
ANSWER = 'J'.
MOVE TITEL TO GL_TITEL.
SPOP-TEXTLINE1 = TEXTLINE1.
SPOP-TEXTLINE2 = TEXTLINE2.
SPOP-TEXTLINE3 = TEXTLINE3.
V_LENGTH = VALUELENGTH.
CLEAR SPOP-VARVALUE1.
CALL SCREEN 100 STARTING AT 25 6
ENDING AT 61 12.
VALUE1 = SPOP-VARVALUE1.
ANSWER = ANTWORT.
ENDFUNCTION.
sy-batch = 'X'. "programul ruleaza in background.
In cazul in care prg. ruleaza in background si se doreste folosirea unei functii care in mod normal se foloseste la procesarea in foreground...
if not sy-batch is initial.
sy-batch = ' '.
wa_batch = 'X'.
endif.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
* CODEPAGE = ' '
filename = p_desc
filetype = 'DAT'
* HEADLEN = ' '
* LINE_EXIT = ' '
* TRUNCLEN = ' '
* USER_FORM = ' '
* USER_PROG = ' '
* DAT_D_FORMAT = ' '
* IMPORTING
* FILELENGTH =
TABLES
data_tab = inserare
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2
INVALID_FILESIZE = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
customer_error = 9
OTHERS = 10.
IF sy-subrc <> 0 .
message i999(zbc) with 'Eroare scriere fisier'.
else.
write: 'am scris in ' , p_desc.
ENDIF.
if wa_batch = 'X'.
sy-batch = 'X'.
endif.
Sau, se poate folosi:
DATA: p_fileName LIKE rlgrap-filename,
tmpMblnr(19) VALUE 'TEST-document.txt',
path(26) VALUE '\\network_pc\dataset_test\'.
* "network_pc" could also be an IP-address if you don't have DNS available.
CONCATENATE path tmpMblnr INTO p_fileName.
OPEN DATASET p_fileName FOR OUTPUT IN TEXT MODE. "vezi explicatie jos
LOOP AT FileTab INTO FileTabWa.
TRANSFER FileTabWa TO p_fileName.
ENDLOOP.
CLOSE DATASET p_fileName.
.....IN TEXT MODE
If you use this addition, the contents of the file are structured in lines. Each time you use the READ DATASET or TRANSFER statement, the system reads or writes a single line. If the data object to which you are transferring the data is too big, it is padded with spaces. If it is too small, the data record is truncated.
data: p_intval like wmto_s-amount,
gd_disval like wmto_s-amount.
p_intval = gt_amnt_all-u_verpr.
call function 'CURRENCY_AMOUNT_SAP_TO_DISPLAY'
exporting
currency = 'ROL'
amount_internal = p_intval
importing
amount_display = gd_disval
exceptions
internal_error = 1
others = 2.
if sy-subrc eq 0.
gt_amnt_all-u_verpr = gd_disval.
endif.
clear gd_disval.
clear p_intval.