工作生活与爱好

工作中的记录; 生活中的记忆; 业余爱好的记载。

2007-01-20

 

Smartforms FAQ Part Two

Smartforms output difference
Problem with Smartforms: in a certain form for two differently configured printers, there seem to be a difference in the output of characters per inch (the distance between characters which gives a layout problem - text in two lines instead of one.

It happens when the two printers having different Printer Controls' if you go to SPAD Menu (Spool Administrator Menu) you can see the difference in the Printer Control and if you make the Printer control setting for both the printers as same. then it will be ok. and also u have to check what is the device type used for both the output devices.

SmartForms Output to PDF
There is a way to download smartform in PDF format.
Please do the following:
1. Print the smartform to the spool.
2. Note the spool number.
3. Download a PDF file (Acrobat Reader) version of the spool by running Program RSTXPDFT4 and entering the
noted spool number.

SmartForm Doublesided printing question
Your customer wants your PO SmartForm to be able to print "Terms and Conditinos" on the back side of each page. They don't want to purchase pre-printed forms with the company's logo on the front and terms & conditions on the back. Now this presents an interesting problem.
Has anyone else ever had a request like this? If for example there was a 3 page PO to be printed, they want 3 pieces of paper, the front side of each to containe the PO information (page 1, 2, and 3) and the back side of each piece of paper to containg the static "Terms & Conditions" information.
Anyone have a clue how to force this out?

Easy - page FRONT lists page CONTACTS as next page and CONTACTS lists FRONT as next page. Since CONTACTS does not contain a MAIN window, it will print the contacts info and then continue on to FRONT for the rest of the main items. Additionally, set print mode on FRONT to D (duplex) and set CONTACTS to 'blank' (for both resource name and print mode - this is the only way to get to the back of the page).

Transport Smart Forms
How does one transport SMARTFORM? SE01?
How do you make sure that both, the SMARTFORM & it's function module gets transported? Or does the FM with same name gets generated automatically in the transported client?

A smartform is transported no differently than any other object. if it is assigned to a development class that is atteched to a transport layer, it will be transported.
The definition is transported, and when called, the function module is regenerated.
This leads to an interetsing situation. On the new machine, it is very likely the function module name will be different than the name on the source system. Make sure, before you call the function module, you resolve the external name to the internal name using the 'SSF_FUNCTION_MODULE_NAME' function module.
Typically, generate the SF, then use the pattern to being in the interface. Then change the call function to use the name you get back from the above function module.

Smartforms: protect lines in main window.
How to protect lines in the main window from splitting between pages?

It was easy with SAPscript, but how to do it with SF's. For 4.7 version if you are using tables, there are two options for protection against line break:
- You can protect a line type against page break.
- You can protect several table lines against page break for output in the main area.

Protection against page break for line types
- Double-click on your table node and choose the Table tab page.
- Switch to the detail view by choosing the Details pushbutton.
- Set the Protection against page break checkbox in the table for the relevant line type. Table lines that use this line type are output on one page.

Protection against page break for several table lines
- Expand the main area of your table node in the navigation tree.
- Insert a file node for the table lines to be protected in the main area.
- If you have already created table lines in the main area, you can put the lines that you want to protect again page break under the file using Drag&Drop. Otherwise, create the table lines as subnodes of the file.
- Choose the Output Options tab page of the file node and set the Page Protection option. All table lines that are in the file with the Page Protection option set are output on one page.

In 4.6, Alternatively in a paragraph format use the Page protection attribute to determine whether or not to display a paragraph completely on one page. Mark it if you want to avoid that a paragraph is split up by a page break. If on the current page (only in the main window) there is not enough space left for the paragraph, the entire paragraph appears on the next page.


 

Display a contents of a table on SmartForm with LOOP

There's a DDIC Table called "Ugyfel" containing 5 rows. I'd like simply to display all the rows on a SF's Main window.

Please follow this process to display the value from your table "Ugyfel"

1. Go with a transaction code : smartforms
2. Enter the form name like : ysmart_forms1
3. Create
4. Enter the Description for the form
5. From the left side window there will be a form interface to provide table .....
6. Go for tables option
7. ugyfel like ugyfel(ref.type)
8. Pages and window---> page1---> main window
9. Go to the form painter adjust the main window.
10. Select main window and right click --> go for create loop
11. Name: loop1, desc: display loop.
12. Internal table ktab into ktab.
13. select loop right click -> create a text
14. name : text1, desc: display text.
15. Go to change editor.
16. Write the mater what ever you want and if you want to display data from the table write the table fields as follows:

&ktab-& &ktab-&

save & activate then execute ,, scripts will generate a function module like : '/ibcdw/sf0000031' copy this function module and call in executable program...

For that
1. go with abap editor se38.
2. table: ugyfel.
3. parameters: test like ugyfel-.
4. data itab like ugyfel occurs 0 with header line.
5. select * from ugyfel into table itab where field1 = test1.
6. call function '/ibcdw/sf0000031'
7. tables
ktab = itab.

Save and activate the program ( ^f 3).

Now run the program ( f 8)

ALL THE BEST.


 

Internal Table in Smartform

Here is a sample program in which used two internal tables:

REPORT YPRINTPRG_SMARTFORM1 .
DATA : ITKNA1 LIKE KNA1,
ITVBAK LIKE VBAK OCCURS 0 WITH HEADER LINE.
PARAMETERS : PKUNNR LIKE KNA1-KUNNR.

SELECT * FROM KNA1 INTO ITKNA1
WHERE KUNNR = PKUNNR.
ENDSELECT.

SELECT * FROM VBAK
INTO TABLE ITVBAK
WHERE KUNNR = PKUNNR.

CALL FUNCTION '/1BCDWB/SF00000011' “THIS FUNCTION MODULE CALLS THE
SMART FORM WE WILL GET THIS AT MENU ENVIRONEMENT ”
EXPORTING
ITKNA1 = ITKNA1
TABLES
ITVBAK = ITVBAK.

IN SMART FORM
FORM INERFACE---------IMPORT (TAB)
Parameter name Type assignment Reference type Default value
ITKNA1 LIKE KNA1

FORM INERFACE---------TABLES (TAB)
ITVBAK LIKE VBAK

PAGES & WINDOWS----- MAIN WINDOW-----LOOP 1----DATA(TAB)
ITVBAK INTO ITVBAK

PAGES & WINDOWS-------MAIN WINDOW------LOOP 1-----TEXT 3(EDITOR)
&ITVBAK-VBELN& &ITVBAK-ERDAT& &ITVBAK-ERNAM& &ITVBAK-NETWR&

PAGES & WINDOWS-------HEADER WINDOW-----TEXT 2(EDITOR)
Customer No. &itkna1-kunnr& CustomerName :&itkna1-name1&


 

Questions for Bar Code Printing in SAP

1. Can we print bar codes in SAP only from ZEBRA printers ?

2. I had read that bar code printing is enabled in SAP and only needs to configure device/printer for that. Does this mean that we can use our existing HP 2300 or like printers to print bar codes without any ZEBRA like printers and the printed bar codes are readable through any reader ?

3. Are there any specific steps to print bar codes from SAP (from within Smartforms) including data fetch and printer configurations.

4. What is the process or method for reading data in bar code form into sap ( as far as I think that we can upload the txt file created from reader and upload it to SAP ). Can we do this without uploading TXT file i.e. directly reading from bar code reader into SAP. In other means what are the normal ways to read bar codes data into SAP.

Furthermore, we have taken a zebra Z4M plus printer from one of vendor on trial basis but even after following the recommended steps as mentioned in the config. manual we are unable to print any thing on bar code printer from within SAP.

I do agree that we can print bar codes from excel or from outside SAP but we wanted to print it out from within SAP and we think SMARTFORM is an easier way as compare to SAPSCRIPT (although we don't have any idea of printing bar codes from SAPSCRIPTs).

About reading from bar code reader .... yes we know that we have to read the bar codes into a ASCII or text file but in that case we need to write a ABAP program to upload that information into SAP to do MIGO (in our case) and for that we also need to fill in certain other information into that text file after reading bar codes ....?? is there any other simpler way of doing this ???

We are able to print barcodes from smartforms. Doing this way, we print barcodes on laser printers.

We are also printing from sap to zebra printers using two ways:
1. Download the data to an excel sheet, then creating a macro that opens the printer port and sending the commands to the printer through this "file". All this is done via vb script provided with excel)..
2. The second way is creating a vbscript (an ascii file from sap) with the printer commands and then runing it using ws_execute.

You need a barcode reader to read the barcodes, and this scanner acts like a keyboard, it sends the data scanned to the active field on screen. (which might be a notepad, word, excel or an input field or ... ).

Back to your problem:

1. We're using Zebra 2746-e (Eltron) to print labels that have some barcodes in their design. There are several approaches to solve this problem. We've decided to work with the programming language of the printer (EPL-2), because we use the zebra printers from SAP or from other windows applications.

Our solution was to develope function module that creates an ascii file (a vbscript file) and then use the ws_execute to run wscript with this file. The vbscript just opens the port for output and sends a sequence of writeline, each of them with a command to the printer. After all the commands were sent to the printer, we close the port . Just note that the port acts the same as a file.

This is an EXAMPLE of the visual basic script code;

Set fs=CreateObject("Scripting.FileSystemObject")
Rem send the output to COM1 port.
Set a = fs.CreateTextFile("COM1:",True)
Comilla = Chr(34)
a.writeline "O"
a.writeline "ZB"
a.writeline ""
a.writeline ""
a.writeline ""
a.writeline "N"
a.writeline ""
a.writeline ""
a.writeline "q800"
a.writeline "Q635,24+0"
a.writeline "R32,24"
a.writeline "S3"
a.writeline "D8"
a.writeline "ZT"
a.writeline ""
rem this is an example of barcode ean128-ucc
a.writeline "B126,429,0,1E,3,3,61,B,""011234567890123410051215"""
rem this is an example of barcode 3 of 9 rotated
a.writeline "B10,495,3,1,3,3,49,B,""01234567"""
a.writeline ""
a.writeline ""
a.writeline "P1"
a.writeline ""
a.Close

We've send this code to an ascii file or as part of a macro to be run within an excel sheet. We have succeed in both cases.
The zebra printer is created as local to the computer running the vbscript. We haven't been able to share the zebra printer so other people in the network can use it. And the zebra printer isn't installed as a SAP printer (we aren't using sap spooler to send jobs to the zebra). Another Note: zebra 2746 comes with a software bar-one (or something like that) that allows you to design the barcode label in a wysiwyg way

If my memory isn't failing, I think that I've read something about controlling zebra printers from smartforms in service.sap.com, but I haven't explored this possibility.

2. From 4.6c on, you can use smartforms to print barcodes without buying any barcode.dll software nor hardware extention like Bardimm on any laser/inkjet printer (Please Note that I haven't mentioned Zebra printers here!). To do this, you have to create a smartstyle -> character format with the desired barcode font (defined within sap). Then in the smartform, create a window, put the field and associate it the character format. That's all (I mean, that's all we do at least :-). I think, you have to consider the barcode specifications before sending the barcode value to the smartform (Just an example, if you're using 3 of 9, the code should start and end with an asterisk - '*' -) We're printing an interleaved 2 out of 5 barcode in our invoices due to a legal requirement, and we did it this way.

3. If you have a barcode scanner, then you should not need reading the barcode into an ascii file to get the data read in an standard or custom screen field. You can read it directly to the field you want. (unless... you have complex data coded in the barcode - for example if you're using an ean-ucc 128 compliant code and you're sending several fields in a single code ... In this case, an interface is almost mandatory because you must interpret the data fields according to the ucc standard, split the code into several fields .... and .... pure programming logic ).
To put it clear: if you have to read, for example, a barcode that holds the legal number of an invoice using a barcode scanner and this number should be sent to migo-> bktxt then you don't need an interface. The scanner itself acts like a fast operator entering the characters using a keyboard and filling in the field.
We're reading barcodes in several places (when we finish each pallet, when we receive an invoice, and so on. Each case is a different screen. We arent using an ascii file to read these barcodes. Furthermore, we read the invoice legal number into migo bktxt field (Head Text).


 

ABAP动态生成经典应用之Dynamic SQL Excute 程序

开发说明:在SAP的系统维护过程中,有时我们需要修改一些Table中的数据,可是很多Table又不能直接在Tcode:SE16中修改, 使用的SAP ID又没有调试数据修改权限,这时我们应该怎么样修改数据呢?思路--> ABAP程序中的SQL 更新语句谁都有权限执行,只要我们能动态生成修改该Table字段的ABAP CODE动态执行即可!
开发技术:
1.SQL代码编写技术
1.动态程序代码生成技术
2.ABAP动态程序执行技术
注意事项:
SQL语法一定要准确,修改条件准确,修改数据后不违法数据唯一性原则
程序代码:如下
*******************************************************************
* (Copyright @2006 Mysingle Digital System Co.Ltd.
* All Rights Reserved|Confidential)
* System Module : ABAP CBO
* Use Status : Release 1.0
*******************************************************************
REPORT z_cbo_abap_02 MESSAGE-ID zp NO STANDARD PAGE HEADING.
DATA : fcode LIKE sy-ucomm,
changed LIKE s38e-buf_varied,
save_tabix LIKE sy-tabix,
tabix_count TYPE i,
select_key(10) TYPE c,
etc(80) TYPE c,
update_flag TYPE c,
line_cnt TYPE i,
prog(8) TYPE c,
msg(120) TYPE c,
msg_text(72) TYPE c,
confirm_flag TYPE c.
DATA: itab_sql LIKE abapsource OCCURS 0 WITH HEADER LINE,
itab_prog LIKE abapsource OCCURS 0 WITH HEADER LINE.
START-OF-SELECTION.
*程序执行直接进入ABAP代码编辑器
SET PF-STATUS 'PFSTA00'.
WRITE: /1 'Edit Your SQL ................' COLOR 2.
AT USER-COMMAND.
*动态生成程序修改确认
IF sy-ucomm = 'EDIT'.
PERFORM editor_sql.
*动态生成程序执行
ELSEIF sy-ucomm = 'EXEC' OR sy-ucomm = 'EDEX'.
REFRESH itab_prog.
CLEAR itab_prog.
IF update_flag = 'X'.
PERFORM exec_modify.
ENDIF.
ENDIF.
*&------------------------------------------------------------------*
*& Form editor_sql
*&------------------------------------------------------------------*
FORM editor_sql.
* CALL Editor
CALL FUNCTION 'EDITOR_APPLICATION'
EXPORTING
application = 'BF'
display = ' '
name = '[Edit Your SQL......]'
IMPORTING
fcode = fcode
changed = changed
TABLES
content = itab_sql.
* Translate Code Upper
LOOP AT itab_sql.
save_tabix = sy-tabix.
tabix_count = tabix_count + 1.
IF itab_sql-line = space OR itab_sql-line+(1) = '*'.
DELETE itab_sql INDEX save_tabix.
ENDIF.
TRANSLATE itab_sql-line TO UPPER CASE.
MODIFY itab_sql INDEX save_tabix.
ENDLOOP.
* Parsing input SQL code
LOOP AT itab_sql.
IF sy-tabix = 1.
SHIFT itab_sql-line LEFT DELETING LEADING space.
ENDIF.
save_tabix = sy-tabix + 1.
SPLIT itab_sql-line AT space INTO select_key etc.
IF select_key = 'SELECT'.
MESSAGE i433 WITH 'Donot support select syntax!^~^'.
stop.
* hehe~~Don't bother myself.
ELSEIF select_key = 'DELETE' OR select_key = 'UPDATE'
OR select_key = 'INSERT'.
update_flag = 'X'.
ENDIF.
ENDLOOP.
* Display the SQL code
sy-lsind = 0.
DELETE itab_sql WHERE line IS initial.
DESCRIBE TABLE itab_sql LINES line_cnt.
IF line_cnt = 0.
WRITE: /1 'Edit Your SQL ................' COLOR 2.
ELSE.
LOOP AT itab_sql.
WRITE: /1 itab_sql-line.
ENDLOOP.
ENDIF.
IF update_flag = 'Y'.
EXIT.
ENDIF.
ENDFORM. " editor_sql
*&------------------------------------------------------------------*
*& Form exec_modify
*&------------------------------------------------------------------*
FORM exec_modify.
IF sy-ucomm = 'EXEC'.
* Modify dialog box
CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
EXPORTING
textline1 = 'Do you want to really UPDATE?'
titel = 'Exit'
IMPORTING
answer = confirm_flag.
CASE confirm_flag.
WHEN 'N'. EXIT. "NO
WHEN 'A'. EXIT. "Cancel
WHEN 'J'. "perform exec_sql_update. "YES
ENDCASE.
ENDIF.
* Modify Program ABAP Code.
itab_prog-line = 'PROGRAM ZSQL19800526 MESSAGE-ID AT.'.
APPEND itab_prog.
itab_prog-line = 'DATA: COUNT TYPE I.'.
APPEND itab_prog.
itab_prog-line = 'FORM DYN2.'.
APPEND itab_prog.
itab_prog-line = 'EXEC SQL.'.
APPEND itab_prog.
LOOP AT itab_sql.
itab_prog-line = itab_sql-line.
APPEND itab_prog.
ENDLOOP.
itab_prog-line = 'ENDEXEC.'.
APPEND itab_prog.
itab_prog-line = 'MESSAGE I315 WITH ''Performed'' SY-DBCNT'.
CONCATENATE itab_prog-line '''' 'Records!^-^' '''' '.'
INTO itab_prog-line SEPARATED BY space.
APPEND itab_prog.
itab_prog-line = 'ENDFORM.'.
APPEND itab_prog.
* Dynamic Program Display
IF sy-ucomm = 'EDEX'.
CALL FUNCTION 'EDITOR_APPLICATION'
EXPORTING
application = 'BF'
display = ' '
name = 'Modify Program...'
IMPORTING
fcode = fcode
TABLES
content = itab_prog.
STOP.
ENDIF.
* Dynamic Program Excuted
GENERATE SUBROUTINE POOL itab_prog NAME prog
MESSAGE msg.
IF sy-subrc <> 0.
msg_text = msg+(80).
WRITE: /1 msg_text.
msg_text = msg+80(40).
WRITE: /1 msg_text.
ELSE.
PERFORM dyn2 IN PROGRAM (prog).
ENDIF.
ENDFORM. " exec_modify
程序实例:
1.程序执行界面,显示SQL CODE录入画面
2.我们要修改的数据,材料主数据Material Master Table:MARA中的材料CODE主键
SOH-DL3C ---> SOH-DL8C
3.数据修改SQL语句编写,这里就不详叙了

UPDATE MARA SET MATNR = 'SOH-DL3C' WHERE MATNR = 'SOH-DL8C'
AND ERSDA = '20040310'
4.修改动态ABAP程序生成确认修改

5.动态程序执行

6.程序成功执行提示信息

7.数据修改效果确认


 

ABAP动态生成经典应用之Table数据Upload 程序

开 发说明:在CBO的程序开发过程中,需要为Table准备大量的测试数据,手动录入效率低,不专业,我们可以采用其他的高级编辑工具(例如:EXCEL, EditPlus)按照Table数据存储结构准备好数据,最后保存为ASC的文本文件,通过执行下面开发的程序,下面的程序执行的功能就是把编辑好的文 本文件上的数据上载到SAP对应的Table中,小程序非常实用,也适用于我们大量更新Table数据时使用,ABAPer们的手头必备啊!
开发技术:
1.文本文件上载技术
2.动态程序代码生成技术
3.ABAP动态程序执行技术
4.TXT文本文件对应用Table字段编辑技术
注意事项:
文件文件编辑过程中时间日期格式为 20060201 120000 表示 2006.02.01 12:00:00
文本文件中不能包含除字符,数字之外的其他特殊符号。假如Table中对应的字段数据为空时,在编辑数据时也对应该列为空。
程序代码:如下
*******************************************************************
* (Copyright @2006 Mysingle Digital System Co.Ltd.
* All Rights Reserved|Confidential)
* System Module : ABAP CBO
* Program Description : Table Upload & Download
* Developer : ZOU XIN
* Develop Date : 2006.01.01
* Use Status : Release 1.0
*******************************************************************
REPORT z_cbo_abap_01 NO STANDARD PAGE HEADING.
TABLES : dd03l,dd02t.
DATA: BEGIN OF tab OCCURS 10,
fcode(4),
END OF tab.
DATA : BEGIN OF itab OCCURS 0,
chk(1) TYPE c, " check box
tabname LIKE dd03l-tabname, " Table name
fieldname LIKE dd03l-fieldname, " Feld Name
position LIKE dd03l-position, " Table
keyflag LIKE dd03l-keyflag, " Primary Key
datatype LIKE dd03l-datatype, " Data Type
intlen LIKE dd03l-leng,
END OF itab.
DATA itab1 LIKE itab OCCURS 0 WITH HEADER LINE.
DATA : BEGIN OF uptab OCCURS 0,
text(72) TYPE c,
END OF uptab.
DATA: BEGIN OF error_message,
line1(72),
line2(72),
line3(72),
END OF error_message.
DATA : cnt1(8) TYPE c,
fcode LIKE sy-ucomm,
changed LIKE s38e-buf_varied,
prog(8) TYPE c,
msg(120) TYPE c,
er_include LIKE sy-repid,
er_line LIKE sy-index,
er_off LIKE sy-tabix,
er_subrc LIKE sy-subrc.
* 程序录入界面
PARAMETERS : tabname LIKE dd03l-tabname DEFAULT 'ZP023'.
START-OF-SELECTION.
*上载Table字段分析
SELECT SINGLE * FROM dd02t WHERE tabname = tabname.
SET PF-STATUS 'ZOUXIN'.
SELECT * INTO CORRESPONDING FIELDS OF TABLE itab FROM dd03l
WHERE tabname = tabname
AND as4local = 'A'
ORDER BY position.
itab-chk = 'X'.
MODIFY itab INDEX 1 TRANSPORTING chk .
*动态上载程序代码生成函数
PERFORM generate_upload_code.
*ABAP程序代码编辑器调用
PERFORM edit_generator_code.
AT USER-COMMAND .
IF sy-ucomm = 'EDIT'.
PERFORM edit_generator_code.
ELSEIF sy-ucomm = 'EXEC'.
GENERATE SUBROUTINE POOL uptab NAME prog MESSAGE msg.
*程序代码语法检测
PERFORM chcek_syntax_error.
*动态程序代码执行
PERFORM dyn1 IN PROGRAM (prog).
ENDIF.
*&amp;amp;amp;amp;amp;amp;amp;---------------------------------------------------------------*
*& Form generate_upload_code
*&---------------------------------------------------------------*
FORM generate_upload_code.
REFRESH uptab.
uptab-text = 'REPORT ZUP19800526.'.
APPEND uptab.
CONCATENATE 'TABLES :' tabname '.' INTO uptab-text
SEPARATED BY space.
APPEND uptab.
uptab-text = 'DATA : BEGIN OF UPTAB OCCURS 0,'.
APPEND uptab.
LOOP AT itab WHERE chk = ''.
CLEAR uptab.
CONCATENATE ' ' itab-fieldname '(' itab-intlen ')' ' TYPE C ,'
INTO uptab-text+10(80).
APPEND uptab.
ENDLOOP.
uptab-text+6(82) = 'END OF UPTAB.'.
APPEND uptab.
uptab-text = 'DATA : BEGIN OF RESULT OCCURS 0.'.
APPEND uptab.
CLEAR uptab.
CONCATENATE 'INCLUDE STRUCTURE' itab-tabname '.'
INTO uptab-text+10(80) SEPARATED BY space.
APPEND uptab.
uptab-text = 'DATA : END OF RESULT.'.
APPEND uptab.
uptab-text = 'FORM DYN1.'.
APPEND uptab.
CLEAR uptab.
uptab-text+2(88) = 'CALL FUNCTION ''UPLOAD'''.
APPEND uptab.
CLEAR uptab.
uptab-text+4(86) = 'EXPORTING'.
APPEND uptab.
CLEAR uptab.
uptab-text+6(84) = 'FILENAME = ''C:\'''.
APPEND uptab.
uptab-text+6(84) = 'FILETYPE = ''DAT'''.
APPEND uptab.
uptab-text+4(86) = 'TABLES'.
APPEND uptab.
CLEAR uptab.
uptab-text+6(84) = 'DATA_TAB = UPTAB.'.
APPEND uptab.
uptab-text+2(88) = 'LOOP AT UPTAB.'.
APPEND uptab.
CLEAR uptab.
uptab-text+4(86) = 'CLEAR RESULT.'.
APPEND uptab.
uptab-text+4(86) = 'MOVE-CORRESPONDING UPTAB TO RESULT.'.
APPEND uptab.
uptab-text+4(86) = 'APPEND RESULT.'.
APPEND uptab.
uptab-text+2(88) = 'ENDLOOP.'.
APPEND uptab.
CLEAR uptab.
CONCATENATE 'INSERT' itab-tabname 'FROM TABLE RESULT.'
INTO uptab-text+2(88) SEPARATED BY space.
APPEND uptab.
uptab-text = 'ENDFORM.' .
APPEND uptab.
CLEAR uptab.
ENDFORM. " generate_upload_code
*&---------------------------------------------------------------*
*& Form edit_generator_code
*&---------------------------------------------------------------*
FORM edit_generator_code.
CALL FUNCTION 'EDITOR_APPLICATION'
EXPORTING
application = 'BF'
display = ' '
name = 'Source Code.....'
IMPORTING
fcode = fcode
changed = changed
TABLES
content = uptab.
LOOP AT uptab.
WRITE:/1 uptab-text.
ENDLOOP.
ENDFORM. " PRINT_GENERATOR_CODE
*&---------------------------------------------------------------*
*& Form chcek_syntax_error
*&---------------------------------------------------------------*
FORM chcek_syntax_error.
CALL FUNCTION 'EDITOR_SYNTAX_CHECK'
EXPORTING
i_global_check = ' '
i_global_program = ' '
i_program = 'ZUP19800526'
i_r2_check = ' '
i_r2_destination = ' '
i_trdir = ' '
IMPORTING
o_error_include = er_include
o_error_line = er_line
o_error_message = error_message
o_error_offset = er_off
o_error_subrc = er_subrc
TABLES
i_source = uptab.
IF er_subrc <> 0.
er_line = er_line - 2.
WRITE:/1 'Error Line : ',er_line.
WRITE:/1 error_message-line1,error_message-line2,
error_message-line3.
STOP.
ENDIF.
ENDFORM. " chcek_syntax_error
1.程序初始界面,输入Upload的table名.
2.程序运行第一界面,显示程序自动生成的上载程序代码

3.程序运行第二界面,确认程序自动生成的上载程序代码,执行



















4.程序运行第三界面中小界面,程序执行提示输入上在数据具体路径
4.OK,数据上载成功
补充1:上载数据文件格式,*.TXT DAT格式文件,俗称纯文本文件
补充2:SAP Table格式,注意不要理会Mandt Client字段,其他字段数据对应

 

Debug法修改Table数据

There is a way to change entries of a table with SE16 even if you don't have the authorization:

Go in SE16, enter your table Name (ex: MARA).



Display the entry (or entries) you want to modify.

When you have your entry, write '/H' to go in debug mode.



Cross the line you want to modify and press F7 (display function). Here, you are in the code...
Press F7 again to skip some code...
Now you should see the code:

Refresh Exclude_Tab.
If Code = 'SHOW'.
Set Titlebar 'TAB' With Name 'anzeigen'(100).
Elseif Code = 'EDIT'.
...


Change the value from SHOW to EDIT, click Change FLD Contents, and press F8...
or to delete an entry

Change the value from SHOW to DELE, click Change FLD Contents, and press F8...
Here we are... You can change the value to what you want, and don't forget to save!






 

SAP-ABAP DESCRIBE FIELD 用法

DESCRIBE 语句一共有三类用法,先简述一下 DESCRIBE FIELD的用法:
Field Properties 1. DESCRIBE FIELD ...
Properties of an Internal Table 2. DESCRIBE TABLE ...
Distance Between Two Fields 3. DESCRIBE DISTANCE ...

  • Field Properties
    作用:对一个Elementary data的属性进行描述,就是说可以通过这条语句知道某一个data的类型、长度、小数点、输出长度等信息。语法如下。
    DESCRIBE FIELD dobj
    [TYPE typ [COMPONENTS com]]
    [LENGTH ilen IN { BYTE | CHARACTER } MODE]
    [DECIMALS dec]
    [OUTPUT-LENGTH olen]
    [HELP-ID hlp]
    [EDIT MASK mask].
    1. ... TYPE typ [COMPONENTS com]
    DESCRIBE FIELD data1 TYPE typ1 COMPONENTS com1.
    运行结果是data1的类型被存储在typ1变量里,com1则存放了data1里面有几个子元素。

    2. ... LENGTH ilen IN { BYTE | CHARACTER } MODE
    DESCRIBE FIELD data1 LENGTH ilen IN BYTE CHARACTER MODE.
    运行的结果是data1定义的长度存在了ilen里。
    3. ... DECIMALS dec
    DESCRIBE FIELD data1 DECIMALS dec.
    运行的结果是如果data1是小数,dec则存放了小数点后的位数。
    4. ... OUTPUT-LENGTH olen
    DESCRIBE FIELD data1 OUTPUT-LENGTH olen.
    运行的结果是data1的输出长度存在了olen里。
    5. ... HELP-ID hlp
    DESCRIBE FIELD carrid HELP-ID hlp.
    如果data1是由ABAP Dictionary 里的data element决定,data1的数据类型就会被存放在 hlp里。
    6. ... EDIT MASK mask
    DATA: time TYPE s_fltime,
    seconds TYPE i,
    msk TYPE string.
    DESCRIBE FIELD time EDIT MASK msk.
    seconds = 333.
    WRITE seconds USING EDIT MASK msk.

 

SAP-ABAP SKIP 语句

SKIP

SKIP { [n]
| {TO LINE line} }.

其实这些都是Online help,或者在ABAP环境中按F1呼出就可以查得到,但若不是仔细看,还真不知道有这么多细节,读者如果觉得有疑问,请参考源英文文档。

作用

将list cursor(可以理解为光标)位置下移一行或多行,或直接移直指定行数位置。

SKIP [n].

作用

该语句的作用是将list cursor移动n行,新起行的位置决定于变量n,n的data object是I。有如下情况:
n<=0 该语句被忽略
n未赋值 则按照 SKIP 1 执行

cursor位置的确定如下:

  • 如果当前list cursor是由一条输出语句( WRITE, ULINE)确定,执行SKIP n 语句的效果为以该行为基准,list cursor的位置向下移动n行的开头。
  • 如果当前list cursor是由一条定位语句( BACK, NEW-LINE, NEW-PAGE, SKIP)确定,执行SKIP n 语句的效果为以该行为基准,list cursor的位置向下移动n-1行的开头。

注意下列情况:

  • 如果list cursor无法被放置在当前页,将新建一页,新建的页与当前页有相同的page footers。list cursor将被放置在page footers下第一行的开头。
  • The statement is only executed at the start of the page if this page is the first in a list level, or it was generated using the statement NEW-PAGE. (暂不理解,未翻译)

注:

SKIP语句看上去是创建了n个空行,但这些空行是没有内容的,因此不能被Format语句格式化,只有Write语句结合SET BLANK LINES 才能产生可格式化的空行。

SKIP TO LINE line.

作用

令list cursor跳至当前页的某一行开头,由 line 值决定。line也是I类型,有下列情况:
line<=0 或 line >页长度 或遇到 NEW-PAGE SKIP后的TO LINE语句被忽略。SKIP执行,效果同SKIP.

注:

如果list cursor的位置在第一行使用SKIP TO LINE,而且这个list还有Standard page header,输出的结果是第一行会被standard header覆盖。If, however,the cursor is positioned using SKIP TO LINE in the lines of page headers and page footers that are defined for TOP-OF-PAGE and END-OF-PAGE, the page headers or footers are overwritten. (没看太明白,不翻译了)

原文:

SKIP

Syntax

SKIP { [n]
| {TO LINE line} }.


Variants:

1. SKIP [n].

2. SKIP TO LINE line.

Effect

Positions the list cursor under the current line or in any other line.

Variant 1

SKIP [n].


Effect

This statement positions the list cursor in relation to the current line. The new line is determined by the value of n. For n, a data object of type i is expected. If the value of n is smaller than or equal to 0, the statement is ignored. If n is not specified, the statement is executed as if n contains the value 1.

The cursor is positioned as follows:

  • If the line of the current list cursor was set using an output statement ( WRITE, ULINE), the list cursor is set the first position of the line that is n lines under the current line.
  • If the lines of the current list cursor was set using a positioning statement ( BACK, NEW-LINE, NEW-PAGE, SKIP), the list cursor is set in the current position in the line that is n minus 1 lines under the current line.

Note the following special conditions:

  • If the list cursor cannot be positioned on the current page, a new page is created, which includes any page footers that the current page may have. The list cursor is positioned in the first position of the first line under the page header of the new page.
  • The statement is only executed at the start of the page if this page is the first in a list level, or it was generated using the statement NEW-PAGE.


Note

In most application cases, this variant of the statement SKIP works as if it creates n blank lines. You need to ensure, however, that these blank lines have no content that can be formatted by the FORMAT statement. Formattable blank lines can only be generated by the WRITE statement in combination with SET BLANK LINES ON.

Variant 2

SKIP TO LINE line.


Effect

This statement positions the list cursor in the first position of the line on the current page whose number is determined by the value in line. For line, a data object of type i is expected. If the value of line is smaller than or equal to 0, or larger than the page length defined in sy-linct using the addition LINE-COUNT of the program-starting statement, or NEW-PAGE, the addition TO LINE is ignored and the statement SKIP without additions is executed instead.

Note

If the list cursor is positioned in the first list line using SKIP TO LINE, and the list has a standard page header, the output in the first line is overwritten by the standard header. If, however,the cursor is positioned using SKIP TO LINE in the lines of page headers and page footers that are defined for TOP-OF-PAGE and END-OF-PAGE, the page headers or footers are overwritten.

Example

The first SKIP statement generates a blank line for the event TOP-OF-PAGE. The second SKIP statement positions the list cursor in this line.

REPORT demo_skip NO STANDARD PAGE HEADING.

DATA sum TYPE i.

TOP-OF-PAGE.
SKIP.
ULINE.

START-OF-SELECTION.
DO 10 TIMES.
WRITE / sy-index.
sum = sum + sy-index.
ENDDO.

SKIP TO LINE 1.
WRITE: 'Numbers with sum' COLOR COL_HEADING,
sum COLOR COL_TOTAL.


 

SAP-ABAP POSITION 语句

POSITION 语句

语法

POSITION pos.

作用:

这条语句的作用是将list cursor放在当前行的list buffer的 pos 位置。pos是整数类型I, 如果 pos <>

注:

  • POSITION语句后的输出语句如果没有再次指定输出位置,不管剩余的空间是否充足,都将直接输出,如果空间不足则会截断输出的文本。
  • When an output position is output within existing output, please note that the item always refers to the characters stored in the list buffer. If characters that require more than one column in the list are displayed in a Unicode system, the output position displayed can differ from the specified output position, and the content displayed for output that has been partially overwritten, can move, depending on the character used to overwrite. (不太理解,但基本上是如果输出位置与已经输出的区域重合,新的输出将覆盖原有的文本)

原文:

POSITION

Syntax

POSITION pos.

Effect

This statement places the list cursor at the position in the current line in the list buffer specified in pos. The program expects a data object of the type i for pos. If the value of pos is 0 or less or is greater than the page length in sy-linsz defined with the addition LINE-SIZE to the program initiating statement or NEW-PAGE, all subsequent output statements do not create any output until the list cursor is positioned within a line again.

Notes

  • An output statement that follows POSITION and does not have its own position specification pos after AT writes to the specified position regardless of whether or not sufficient space is available on the line, cutting off the output length accordingly, if necessary.
  • When an output position is output within existing output, please note that the item always refers to the characters stored in the list buffer. If characters that require more than one column in the list are displayed in a Unicode system, the output position displayed can differ from the specified output position, and the content displayed for output that has been partially overwritten, can move, depending on the character used to overwrite.


Example

Definition and use of a macro write_frame to draw frames around WRITE output. The POSITION statement positions the list cursor for subsequent output.

DATA: x TYPE i, y TYPE i, l TYPE i.

DEFINE write_frame.
x = sy-colno. y = sy-linno.
WRITE: '|' NO-GAP, &1 NO-GAP, '|' NO-GAP.
l = sy-colno - x.
y = y - 1. SKIP TO LINE y.
ULINE AT x(l).
y = y + 2. SKIP TO LINE y.
ULINE AT x(l).
y = y - 1. x = sy-colno. SKIP TO LINE y. POSITION x.
END-OF-DEFINITION.

SKIP.
WRITE 'Demonstrating'.
write_frame 'dynamic frames'.
WRITE 'in'.
write_frame 'ABAP'.
WRITE 'output lists.'.


 

SAP-ABAP SELECT-SCREEN 的几个用法

如下一段程序:

SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 1.
PARAMETER P_FLEX RADIOBUTTON GROUP ways TYPE c.
SELECTION-SCREEN COMMENT 3(20) text-s30 for field P_FLEX.
SELECTION-SCREEN COMMENT 25(10) text-s31 for field P_PAYM_B.
SELECTION-SCREEN POSITION 38.
PARAMETER P_PAYM_B LIKE PA0015-PABRP MODIF ID wty.
parameters P_PAYY_B LIKE PA0015-pabrj MODIF ID wty.
SELECTION-SCREEN POSITION 57.
SELECTION-SCREEN COMMENT 57(5) text-s32 for field P_PAYM_E.
parameters P_PAYM_E LIKE PA0015-pabrp MODIF ID wty.
parameters P_PAYY_E LIKE PA0015-pabrj MODIF ID wty.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 25.
SELECTION-SCREEN COMMENT 25(9) text-s18 for field S_LGART.
SELECT-OPTIONS S_LGART FOR p0014-LGART MODIF ID wty.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN SKIP 1.

本程序中涉及到几个SELECTION-SCREEN的用法:

1 SELECTION-SCREEN BEGIN OF LINE. ....END OF LINE.

这条语句的作用是让Begin of line 与End of line之间的部分位于同一行。

2 SELECTION-SCREEN POSITION XX.

这条语句的作用是将该语句后面的第一个Screen element定位在这一行的XX位置,最大值为79。值得注意的是,如果同一行中多个Position语句因为空间不够或Element所占空间重叠, 将导致Screen创建时的错误,无法激活。此时并无具体的提示。只能仔细观察代码。

3 SELECTION-SCREEN COMMENT XX(Y) TEXT-XXX FOR FIELD XXX.

这条语句的作用是在当前行的指定列位置处输出一段文本,For field则表示文本与某个element 关联,当此语句使用时,可以不必设定屏幕的Text element,系统会自动关联。XX表示位置,Y表示长度,注意,如果长度不足,超常的文字将被截掉。此处似乎还有一个小BUG,当Y小于5时,输出的 文字字体会变大一号。不知道为什么。

4 SELECTION-SCREEN SKIP 1.

跳过一行。类似于用WRITE写Report时的SKIP 1.也可以跳过多行。


 

SAP ABAP HR信息类型的命名规则

HR信息类型的命名规则

0002 个人信息
0022 教育经历
2001 请假数据

0000-0999 HR主数据 HR master data
1000-1999 人员发展 Personnel Planning
2000-2999 时间管理 Time Management
4000-4999 招聘管理 Recruitment
9000-9999 客户增强 Customer-Specific enhancements


 

ABAP 动态内表构建 Dynamic internal table

这两天做了一个这样的需求,其中要求根据用户输入的工资项(T512W-LGART)查找数据,并输出到ALV,要求是输出跟着输入变。由于工资项的配置信息可能会变,因此用于存储要显示的数据的内表就不能预先知道,因此不得不寻求动态内表的构建方法。

其实网上的例子也有不少,但是都缺少说明,折腾了一上午才弄明白一些,写出来与大家分享。

REPORT Z_DT2.

type-pools : abap.

*t512w为例,构建一个动态内表

tables: t512w.

*field-symbols是一个标志,你可以理解为一个指针,将来创建的内表就要通过它们来访问

field-symbols: type standard table,

,

.

* 这里定义了一个 dy_table 和一个 dy_line 类型是引用,但 to data 未能理解是什么意思,我觉得应该是说指向为空的意思

data: dy_table type ref to data,

dy_line type ref to data,

*用于存储即将构建的动态内表结构

ifc type lvc_t_fcat,

xfc type lvc_s_fcat.

data: begin of t_lgart occurs 0,

LGART like t512w-lgart,

end of t_lgart.

select-options: S_LGART FOR t512w-lgart.

start-of-selection.

*首先从数据库中把符合用户输入的LGART填入内表,将来构建的动态内表每一列就是LGART中的每一行。

select lgart into t_lgart-lgart from t512w where lgart in s_lgart and MOLGA = '28'.

append t_lgart.

endselect.

*循环读取内表t_lgart,对于每行构建内表

loop at t_lgart.

*这里偷了个懒,因为工资项中会有/103这样的数据,而/是不能用左列明的,大家可以自己写一个替换逻辑,把/替换成_之类的字符。

check t_lgart-lgart+0(1) <> '/'.

*列名就用lgart

xfc-fieldname = t_lgart-lgart.

xfc-datatype = 'C'.

xfc-inttype = 'C'.

xfc-intlen = 6.

xfc-decimals = 0.

append xfc to ifc.

endloop.

*此处调用一个方法,这个方法用于构建动态内表,输入的就是要构建的结构,输出的就是一个dy_table,之前定义过,但是并不能直接访问。

call method cl_alv_table_create=>create_dynamic_table

EXPORTING

it_fieldcatalog = ifc

IMPORTING

ep_table = dy_table.

*设定指向 dy_table

assign dy_table->* to .

*下面这句建立了一个类型的工作区Work area

create data dy_line like line of .

*同理设定指针

assign dy_line->* to .

于是便动态的建立了一个内表和一个工作区,由于此方法建立的内表没有header line,所以需要一个工作区。

下面是取数或者赋值的方法:

*此行中的xxxx1就是列名

ASSIGN COMPONENT xxxx1 OF STRUCTURE TO .

*此行的作用就是给中的该列一个值

= xxxx2.

*Append就可以把该行添加到表中了

APPEND TO .

如上所述,即可以动态构建内表,这种方法主要用于表结构无法确定有几列,几有哪些列,尤其与信息配置有关的时候,就只能用这种方法,否则配置一变,程序就不能用了。


 

ABAP 文件名 专用操作函数

SPLIT_FILENAME

输入一个文件路径,如:D:\Dir1\Dir2\F1.txt

输出两个值:PURE_FILENAME 和PURE_EXTENSION,前者的值是:F1,后者的值是TXT

PC_SPLIT_COMPLETE_FILENAME

输入一个文件路径 COMPLETE_FILENAME如:D:\Dir1\Dir2\F1.txt,还有一CHECK_DOS_FORMAT可以不输

输出:

DRIVE驱动器: D
EXTENSION扩展名: TXT
NAME文件名: F1
NAME_WITH_EXT带扩展名的文件名: F1.TXT
PATH路径: \DIR1\DIR2\


 

ABAP基础知识学习

数据类型
C :字符串
D :日期型 格式为 YYYYMMDD 例:'1999/12/03'
F : 浮点数 长度为8
I :整数
N :数值组成的字符串 如:011,'302'
P : PACKED数 用于小数点数值 如:12.00542
T : 时间 格式为:HHMMSS 如:'14:03:00'
X : 16进制数 如:'1A03'
*-------------------------------------------------------------------------------------*
变数宣告

DATA [] [][decimals]
变数名称
变数类型 及 长度
初值
小数位数

exp:
DATA : COUNTER TYPE P DECIMALS 3.
NAME(10) TYPE C VALUE 'DELTA'.
S_DATE TYPE D VALUE '19991203'.
exp:
DATA : BEGIN OF PERSON,
NAME(10) TYPE C,
AGE TYPE I,
WEIGHT TYPE DECIMALS 2,
END OF PERSON.
另外,有關DATA宣告的指令還有: CONSTANTS(宣告常數)、STATICS(臨時變數宣告).
exp:
CONSTANTS PI TYPE P DECIMALS 5 VALUE '3.14159'.
STATICS 敘述
宣告的變數僅在目前的程式中使用, 結束後會自動釋放
語法:
STATICS [] [] []

系統專用變數說明
系統內部專門創建了SYST這個STRUCTURE,里面的欄位存放系統變數,常用的系統變數有:
SY-SUBRC : 系統執行某指令后,表示執行成功与否的變數,'0' 表示成功
SY-UNAME: 當前使用者登入SAP的USERNAME;
SY-DATUM: 當前系統日期;
SY-UZEIT: 當前系統時間;
SY-TCODE: 當前執行程式的Transaction code
SY-INDEX : 當前LOOP循環過的次數
SY-TABIX: 當前處理的是internal table 的第几筆
SY-TMAXL: Internal table的總筆數
SY-SROWS: 屏幕總行數;
SY-SCOLS: 屏幕總列數;
SY-MANDT: CLIENT NUMBER
SY-VLINE: 畫豎線
SY-ULINE: 畫橫線

TYPE 敘述
用來指定資料型態或宣告自定資料型態
Example:
TYPES: BEGIN OF MYLIST,
NAME(10) TYPE C,
NUMBER TYPE I,
END OF MYLIST.
DATA LIST TYPE MYLIST.

LIKE 敘述
跟TYPE敘述使用格式相同, 如
DATA TRANSCODE LIKE SY-TCODE.
不同的是 LIKE 用在已有值的資料項, 如系統變數, 而TYPE敘述則是用
在指定資料型態。

*-------------------------------------------------------------------------------------*
输出

一. WRITE 語句
ABAP/4用來在屏幕上輸出資料的指令是WRITE指令,例如:
WRITE: 'USER NAME IS:', SY-UNAME.
二. 指定屏幕輸出位置
指定輸出位置的語句格式為:
WRITE: [AT] [ / ] [] [()] 資料項 []
其中: / : 在下一行輸出
: 指定輸出的行號;
():指定輸出位數(長度)
: 指定顯示格式參數,參數有:
LEFT-JUSTIFIED 資料*左對齊
CENTERED 資料*中間對齊
RIGHT-JUSTIFIED 資料*右對齊
UNDER 正對在資料項的下面顯示
NO-GAP 緊接著顯示,不留空格
USING EDIT MASK : 使用內嵌子元顯示, 如 12:03:20
USING NO EDIT MASK: 不使用內嵌子元
NO-ZER 數字前面 0 的部分不顯示
NO-SIGN: 不顯示正負號
DECIMALS : 顯示 位小數
EXPOENT : F(浮點數)指數的值
ROUND : 四舍五入至小數點后
CURRENCY : 幣別顯示
DD/MM/YY : 日期顯示格式
MM/DD/YY:
YY/MM/DD:
YY/DD/MM
MM/DD/YYYY:
DD/MM/YYYY
YYYY/MM/DD:
YYYY/DD/MM:
例如1: WRITE: /10(6) 'ABCDEFGHIJK'.
輸出結果為: ABCDEF
例如2: DATA: X TYPE I VALUE '11:20:30',
A(5) TYPE C VALUE 'AB CDE'.
WRITE: / X USING EDIT MASK '__:__:__'.
WRITE: / X USING EDIT MASK '$___,___'.
WRITE: / Y NO-GAP.
輸出結果為:
11:20:30
$112,030
ABCDEF

例如3: DATA: LEN TYPE I VALUE 10,
POS TYPE I VALUE 11,
TEXT(10) VALUE '1234567890'
WRITE 'The text ------------ appears in the text.'.
WRITE AT POS(LEN) TEXT.

WRITE TO 语句的基本 形式
要将值(文 字)或源字 段内容写入 目标字段, 可以使用 WRITE TO 语句:
语法
WRITE TO [].

DATA: NUMBER TYPE F VALUE '4.3',
TEXT(10),
FLOAT TYPE F,
PACK TYPE P DECIMALS 1.
WRITE NUMBER.
WRITE NUMBER TO TEXT EXPONENT 2.
WRITE / TEXT.
WRITE NUMBER TO FLOAT.
WRITE / FLOAT.
WRITE NUMBER TO PACK.
WRITE / PACK.
MOVE NUMBER TO PACK.
WRITE / PACK.

exp:
DATA: NAME(10) VALUE 'SOURCE',
SOURCE(10) VALUE 'Antony',
TARGET(10).
...
WRITE (NAME) TO TARGET.
WRITE: TARGET.

exp :

DATA: COUNTER TYPE I.
COMPUTE COUNTER = COUNTER + 1.
COUNTER = COUNTER + 1.
ADD 1 TO COUNTER.
在此,三条 运算语句进 行相同算术 运算

输出屏幕上 的线和空行

用下列语法 ,可以在输 出屏幕上生 成水平线:
语法
ULINE [AT [/][][()]].
它等同于
WRITE [AT [/][][()]] SY-ULINE.
AT 后的格式规 范,与在 在屏幕上定 位 WRITE 输出 (页 28) 中为 WRITE 语句说明的 格式规范完 全一样。
如果没有格 式规范,系 统则开始新 的一行,并 用水平线填 充该行。否 则,只按指 定输出水平 线。
生成水平线 的另一种方 法,是在 WRITE 语句中键入 恰当数量的 连字符,如 下所示:
WRITE [AT [/][][()]] '-----...'.
垂直线
用下列语法 ,可以在输 出屏幕上生 成垂直线:
语法
WRITE [AT [/][]] SY-VLINE.

WRITE [AT [/][]] '|'.
空行
用下列语法 ,可以在输 出屏幕上生 成空行:
语法
SKIP [].
该语句从当 前行开始, 在输出屏幕 上生成 个空行。如 果没有指定 的值,就输 出一个空行 。
要将输出定 位在屏幕的 指定行上, 请使用:
语法
SKIP TO LINE .
该语句允许 将输出位置 向上或向下 移动。

Archives

1990年1月15日   2007年1月14日   2007年1月15日   2007年1月16日   2007年1月17日   2007年1月18日   2007年1月19日   2007年1月20日   2007年1月22日   2007年1月23日   2007年1月24日   2007年1月25日   2007年1月26日   2007年1月27日   2007年1月29日   2007年1月30日   2007年1月31日   2007年2月1日   2007年2月2日   2007年2月3日   2007年3月13日   2007年5月15日   2007年5月16日   2007年6月2日  

This page is powered by Blogger. Isn't yours?