Se38 -Code
Hello friends,
I have 2 internal tables of the same structure.
I need to insert data into ITAB1 from ITAB2, based on where condition on ITAB1.
IN ITAB1, i have vbeln = 'P01' and is found multiple time. But i want to insert before the last 'P01' in Itab1.
Let me know if i am not clear.
Below is an example of data in ITAB1 and ITAB2.
MAdhu.
DATA : BEGIN OF itab1 OCCURS 0,
vbeln LIKE vbak-vbeln,
matnr LIKE mara-matnr,
END OF itab1.
DATA : BEGIN OF itab2 OCCURS 0,
vbeln LIKE vbak-vbeln,
matnr LIKE mara-matnr,
END OF itab2.
itab1-vbeln = 'A01'.
itab1-matnr = '234'.
APPEND itab1.
itab1-vbeln = 'B01'.
itab1-matnr = '234'.
APPEND itab1.
itab1-vbeln = 'P01'.
itab1-matnr = '234'.
APPEND itab1.
itab1-vbeln = 'P04'.
itab1-matnr = '231'.
APPEND itab1.
itab1-vbeln = 'P20'.
itab1-matnr = '234'.
APPEND itab1.
itab1-vbeln = 'P04'.
itab1-matnr = '231'.
APPEND itab1.
itab1-vbeln = 'P20'.
itab1-matnr = '234'.
APPEND itab1.
itab1-vbeln = 'PT1'.
itab1-matnr = '111'.
APPEND itab1.
itab1-vbeln = 'PT2'.
itab1-matnr = '121'.
APPEND itab1.
itab1-vbeln = 'PT2'.
itab1-matnr = '222'.
APPEND itab1.
itab1-vbeln = 'P01'.
itab1-matnr = '234'.
APPEND itab1.
itab1-vbeln = 'PA1'.
itab1-matnr = '231'.
APPEND itab1.
itab1-vbeln = 'P04'.
itab1-matnr = '234'.
APPEND itab1.
itab1-vbeln = 'PT2'.
itab1-matnr = '1212'.
APPEND itab1.
itab1-vbeln = 'P01'.
itab1-matnr = '2222'.
APPEND itab1.
itab1-vbeln = 'PT1'.
itab1-matnr = '1112'.
APPEND itab1.
itab2-vbeln = 'PT1'.
itab2-matnr = 'MADHU'.
APPEND itab2.
itab2-vbeln = 'PT2'.
itab2-matnr = '1'.
APPEND itab2.
itab2-vbeln = 'PT2'.
itab2-matnr = '2'.
APPEND itab2.
Try this:
DATA: BEGIN OF IT_INDEX OCCURS 0,
TABIX LIKE SY-TABIX,
END OF IT_INDEX.
DATA: LV_LINES TYPE I,
LV_TABIX LIKE SY-TABIX.
Store tabix number of occurence of 'P01'
LOOP AT ITAB2.
IF ITAB2-VBELN = 'P01'.
IT_INDEX-TABIX = SY-TABIX.
APPEND IT_INDEX.
CLEAR IT_INDEX.
ENDLOOP.
Take the last tabix
DESCRIBE TABLE IT_INDEX LINES LV_LINES.
READ TABLE IT_INDEX INDEX LV_LINES.
IF SY-SUBRC EQ 0.
LV_TABIX = IT_INDEX-TABIX.
ENDIF.
Store rows into ITAB1 from last tabix of P01
INSERT LINES OF ITAB2 FROM LV_TABIX INTO ITAB1.
Thanks,
Santosh
Similar Messages
-
SAP R/3 SE38 code of ECC 6.0 to 4.6 C
I am working on an object in which I have to use the existing BDC's of ECC 6.0 system into R/3 4.6C system.
The BDC's are created by recording method for MEK1 transaction and there are nere about 13 BDC's recorded and combined into a single program in ECC 6.0 system. I have to use this program for 4.6C version to perform data upload.
Can anyone please tell me is there any better method available by which I can efficiently executet his 6.0 BDC's in 4.6c system in less efforts since I have to complete this task ASAP.Jose, please check the following thread;
http://help.sap.com/saphelp_nw04/helpdata/en/79/c554d3b3dc11d5993800508b6b8b11/content.htm
where it talks about assignment between structure and single field... You can use direct assignement statement as in the example (before unicode enabling) -
Remote Function Module problem
Hi Experts,
I have written a Se38 progarm to execute a remote function module, so as to send some data out of the system. The receiving system is an XI system. Pls see below the code and the load at the XI end, I donno why and what mistake am I doing in the se38 program part, as a result of which, only part of the data is getting send to XI.
REPORT ZRFC_ADAPTER.
Data: it_final1 type standard table of zrfc_str with header line .
it_final1-NAME = 'ARNAB'.
it_final1-ADDRESS = 'ADDRESS'.
it_final1-EMAIL = 'EMAIL'.
it_final1-ID = 'ID'.
CALL FUNCTION 'ZRFC_XI'
IN BACKGROUND TASK DESTINATION
'R32XIRFC'
EXPORTING
username = sy-uname
tables
it_final = it_final1 .
break-point.
COMMIT WORK.
Clear it_final1.
I have seen in debugging mode, after removing the "
IN BACKGROUND TASK DESTINATION
'R32XIRFC'", that the internal table " it_final1 " is working fine......
The structure used in remote Function Module is
IT_FINAL LIKE ZRFC_STR -- in tables parameter. and the structure of ZRFC_STR is as follows!
NAME ZNAME CHAR 14
ADDRESS ZADDRESS CHAR 40
TELEPHONE ZTEL CHAR 20
EMAIL ZEMAIL CHAR 40
ID ZID CHAR 10
Note that , apart from a COMMIT WORK statement, there is no other coding done in the SOURCE CODE part of the remote Function Module.
The load in XI is showing as
<?xml version="1.0" encoding="UTF-8" ?>
<rfc:ZRFC_XI xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
<USERNAME>RETAILDEV</USERNAME>
<IT_FINAL>
<item>
<NAME>ARNAB</NAME>
<ADDRESS>EMAIL</ADDRESS>
<EMAIL />
<ID />
</item>
</IT_FINAL>
</rfc:ZRFC_XI>
Note that EMAIL is actually a content of field EMAIL and not ADDRESS. But I donno why, it is behaving like this,,
Pls note, this RFC has been imported completely in integration repository of XI, so we dont have to worry about any settings change or activities, left pending in XI.
I am very sure, something is missing in the se38 code, pls suggest!!
Regards,
Arnab .Hi Arnab,
I am having really doubt that there is problem in field mapping.
COuld you please check the following.
In the FM structure contains 5 fields as follows,
NAME ZNAME CHAR 14
ADDRESS ZADDRESS CHAR 40
TELEPHONE ZTEL CHAR 20
EMAIL ZEMAIL CHAR 40
ID ZID CHAR 10
In the Internal Table it has got 4 fields. Check the Mapping properly
and data on each field.
t_final1-NAME = 'ARNAB'.
it_final1-ADDRESS = 'ADDRESS'.
it_final1-EMAIL = 'EMAIL'.
it_final1-ID = 'ID'.
Thanks & Regards,
Nagaraj Kalbavi -
How to show data through table control
Hi Experts,
I have created an table control through wizard using table EKKO.
I have to populate one internal table( type ekko ), and then show it in output through table control.
Please advise, how to do that and in where i have to write the codes.
I will reward points for every suggestion
Thanks in advance.
regardshi saubrab,
This is kiran kumar.G.I am sending some sample code to populate data into table control check it once.
i will give input in 100 screen. and display table control in 200 screen.check it once once ..ok....
SE38 :(CODE)
*& Module pool YMODULEPOOL_TABLECONTROL1 *
*& DEVELOPER : KIRAN KUMAR.G *
*& PURPOSE : TABLE CONTROL DEMO *
*& CREATION DT : 17/12/2007 *
*& T.CODE : YMODTABLECONTROL1 *
*& REQUEST : ERPK900035 *
PROGRAM ymodulepool_tablecontrol1.
Tables
TABLES: yvbap, "Sales Document: Item Data
vbak. "Sales Document: Header Data
Controls
CONTROLS: my_table TYPE TABLEVIEW USING SCREEN 200.
Global Variables
DATA: gv_lines TYPE i,
gv_lines1 type i,
gv_temp type i,
gv_flag(20) TYPE c VALUE 'DISP',
gv_mode1 TYPE c,
gv_mode TYPE c VALUE 'C'. " C: Change, D :Display
Internal Table
DATA: BEGIN OF gt_item OCCURS 0,
vbeln LIKE vbap-vbeln, "Sales Document Number
posnr LIKE vbap-posnr, "Sales Document Item
matnr LIKE vbap-matnr, "Material Number
matkl LIKE vbap-matkl, "Material Group
arktx LIKE vbap-arktx, "Short Text for Sales Order Item
cflag, "Deletion Indicator
END OF gt_item.
*& Module STATUS_0100 OUTPUT
text
MODULE status_0100 OUTPUT.
SET PF-STATUS 'ZTABLECONTROL' OF PROGRAM 'YMODULEPOOL_TABLECONTROL'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
text
MODULE user_command_0100 INPUT.
CASE sy-ucomm.
WHEN 'DISP'.
SELECT single vbeln
erdat
angdt
bnddt
FROM vbak
INTO (vbak-vbeln,vbak-erdat,
vbak-angdt,vbak-bnddt)
WHERE vbeln = vbak-vbeln.
IF sy-subrc EQ 0.
*Fetch the table control data and place them in Internal Table
SELECT vbeln
posnr
matnr
matkl
arktx
FROM yvbap
INTO TABLE gt_item
WHERE vbeln = vbak-vbeln.
IF sy-subrc EQ 0.
*NO OF line in the Internal Table
DESCRIBE TABLE gt_item LINES gv_lines.
my_table-lines = gv_lines + 20.
ENDIF.
ENDIF.
*Call Screen 200.
SET SCREEN 200.
WHEN 'EXIT' OR 'BACK' OR 'CANCEL'.
*Exit from the Program
CALL TRANSACTION 'SESSION_MANAGER'.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
module STATUS_0200 output.
SET PF-STATUS 'ZTABLECONTROL1'.
endmodule. " STATUS_0200 OUTPU
*& Module copy_data OUTPUT
text
module copy_data output.
*Fetch the current line data from the Table control
read table gt_item index my_table-current_line.
if sy-subrc eq 0.
*Populating data into screen fields
gt_item-vbeln = gt_item-vbeln.
gt_item-posnr = gt_item-posnr.
gt_item-matnr = gt_item-matnr.
gt_item-matkl = gt_item-matkl.
gt_item-arktx = gt_item-arktx.
endif.
SE51:CODE (SCREEN 100)
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.
SE51 :CODE (SCREEN 200)
PROCESS BEFORE OUTPUT.
MODULE STATUS_0200.
loop at gt_item with control my_table cursor my_table-current_line.
module copy_data.
endloop.
PROCESS AFTER INPUT.
loop at gt_item.
MODULE USER_COMMAND_0200.
endloop.
HAVE A NICE DAY..
Award points if helpful,kiran kumar.G -
hi,
i have problem in my select query where i am trying to fetch datas from database view.
it takes huge time to process and finally results in run time errors.
help me.
ganesh.For ex: assume that u r creating DB view (say zdbview) for VBAP and MARA.
Select only required fields from two tables when creating the view.
SE38 code:
Data: itab like zdbview occurs 1 with header line.
select * from zdbview into table itab.
loop at itab.
write: / itab-vbeln, itab-matnr, itab-zmwng, itab-mbrsh, itab-mtart.
endloop.
Hope it helps. -
RFC Adapter Settings - stage 3 problems
Hi Experts,
Mine is a RFC to FILE scenerio.I am facing a strange problem. I am sending some data to the RFC through a SE38 program, but only a part of the data is reaching the SXMB_MONI!
See the report program and the Remote function Module below. also the details of the structure is given below:
REPORT ZRFC_ADAPTER.
Data: it_final1 type standard table of zrfc_str with header line .
it_final1-NAME = 'ArnaB'.
it_final1-ADDRESS = 'address'.
it_final1-EMAIL = 'arnab.rudra1gmail'.
it_final1-ID = 'ID'.
append it_final1.
CALL FUNCTION 'ZRFC_XI'
IN BACKGROUND TASK DESTINATION
'R32XIRFC'
EXPORTING
username = sy-uname
tables
it_final = it_final1 .
break-point.
COMMIT WORK.
Clear it_final1.
I have seen in debugging mode, after removing the "
IN BACKGROUND TASK DESTINATION
'R32XIRFC'", that the internal table " it_final1 " is working fine......
The RFC structure
IT_FINAL LIKE ZRFC_STR -- in tables parameter. and the structure of ZRFC_STR is as follows!
NAME ZNAME CHAR 14
ADDRESS ZADDRESS CHAR 40
TELEPHONE ZTEL CHAR 20
EMAIL ZEMAIL CHAR 40
ID ZID CHAR 10
But when checking the SXMB_MONI load , data is incomplete and cut.......Now many of you will suggest re-importing teh RFC in Integratio Repository, and reactivating the communication channel, but i hav done that several times,,,,still the data coming in is incomplete and shreded...i donno why...take a look at teh sxmb_moni output!!
- <rfc:ZRFC_XI xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
<USERNAME>RETAILDEV</USERNAME>
- <IT_FINAL>
- <item>
<NAME />
<TELEPHONE>rudra1</TELEPHONE>
<ADDRESS />
<EMAIL />
<ID />
</item>
</IT_FINAL>
</rfc:ZRFC_XI>
I know, that there is nothin getting stuck in the queue, and had there been anything wrong in the code, nothin would hav worked.....can u guys tell me where am i gettin stuck..
Regards,
ArnabHi Bhavesh,
I did exactly as instructed by u some time back, I believe I hav something or other there wrong in my SE38 report, ......I cant make that out, but dont you think, this is funny, only a part of the data is coming in, and not the full...if there was something wrong, entire load would have vanished!!!..and yes I hav used the COMMIT statement....take a look at the SE38 Code,
REPORT ZRFC_ADAPTER.
Data: it_final1 type standard table of zrfc_str with header line .
it_final1-NAME = 'ArnaB'.
it_final1-ADDRESS = 'address'.
it_final1-EMAIL = 'arnab.rudra1gmail'.
it_final1-ID = 'ID'.
append it_final1.
CALL FUNCTION 'ZRFC_XI'
IN BACKGROUND TASK DESTINATION
'R32XIRFC'
EXPORTING
username = sy-uname
tables
it_final = it_final1 .
break-point.
COMMIT WORK.
Clear it_final1.
Is the loaction of commit work ok.....or do you want me to put it in the Remote Function Module??
Do you think I should put the question in ABAP forum, so that some Remote function Module expert can suggest something....
Pls suggest....
Arnab -
HI Experts,
I have one doubts in smartforms, i m using two SELECT SINGLE statement first SELECT SINGLE is working properly, i m getting employee name but second SELECT SINGLE is provide dump error,
i m providing below my se38 code for ur help. Plz help me as soon as possible.
TABLES: PERNR, PA0000, PA0001, PA0006.
*INFOTYPES: 0000, 0001, 0006.
DATA: V_FORMNAME TYPE TDSFNAME VALUE 'ZWARN_LETTER',
v_fmname type rs38l_fnam.
SELECTION-SCREEN BEGIN OF BLOCK SAN WITH FRAME TITLE Title.
PARAMETERS: EMPNO TYPE PA0000-PERNR OBLIGATORY.
SELECTION-SCREEN END OF BLOCK SAN.
DATA: ENAME LIKE PA0001-ENAME, " EMPLOYEE NAME.
STRAS LIKE PA0006-STRAS,
ORT01 LIKE PA0006-ORT01,
ORT02 LIKE PA0006-ORT02,
PSTLZ LIKE PA0006-PSTLZ,
LOCAT LIKE PA0006-LOCAT.
DATA: BEGIN OF ITAB OCCURS 0,
ENAME LIKE PA0001-ENAME, " EMPLOYEE NAME.
STRAS LIKE PA0006-STRAS,
ORT01 LIKE PA0006-ORT01,
ORT02 LIKE PA0006-ORT02,
PSTLZ LIKE PA0006-PSTLZ,
LOCAT LIKE PA0006-LOCAT.
DATA: END OF ITAB.
*SELECT SINGLE PERNR INTO ITAB-EMPNO FROM PA0000 WHERE PERNR = EMPNO.
SELECT SINGLE ENAME INTO ITAB-ENAME FROM PA0001 WHERE PERNR = EMPNO.
SELECT SINGLE STRAS FROM PA0006 INTO (ITAB-STRAS) WHERE PERNR = EMPNO .
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = v_formname
IMPORTING
FM_NAME = v_fmname
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.
CALL FUNCTION V_FMNAME
EXPORTING
ENAME = ITAB-ENAME.
STRAS = ITAB-STRAS.
ORT01 = ITAB-ORT01.
ORT02 = ITAB-ORT02.
PSTLZ = ITAB-PSTLZ.
LOCAT = ITAB-LOCAT.
Regards,
SwapnikaHI,
In FM
CALL FUNCTION V_FMNAME
EXPORTING
ENAME = ITAB-ENAME.
STRAS = ITAB-STRAS.
ORT01 = ITAB-ORT01.
ORT02 = ITAB-ORT02.
PSTLZ = ITAB-PSTLZ.
LOCAT = ITAB-LOCAT.
Here ITAB is the Internal table. So we can't directly pass internal table values.
Try like this,
just change the declarations.
data : itab-ename type table value,
itab-stras type table value.
Select statements.
call FM -
Get z table data to internal table
hi friends,
when i'm trying to get ztable data to an internal table and run the smartform it's giving a runtime error saying
"In the function module interface, you can specify only fields of a specific type and length under "ITAB".
Although the currently specified field "IT_ZPPR2" is the correct type, its length is incorrect."
here is my se38 code
REPORT ZPPR_2.
TYPE-POOLS: SLIS.
TABLES : MAST, STPO, ZPPR2.
DATA ITAB LIKE ZPPR2 OCCURS 0 WITH HEADER LINE.
TYPES : BEGIN OF TY_FINAL,
WERKS TYPE ZPPR2-WERKS, "PLANT
MATNR TYPE ZPPR2-MATNR, "MATERIAL
MENGE TYPE ZPPR2-MENGE, "QTY
END OF TY_FINAL.
DATA : IT_ZPPR2 TYPE TABLE OF TY_FINAL WITH HEADER LINE,
WA_ZPPR2 TYPE TY_FINAL.
START-OF-SELECTION.
SELECT * FROM ZPPR2
INTO CORRESPONDING FIELDS OF TABLE IT_ZPPR2.
CALL FUNCTION '/1BCDWB/SF00000081'
* 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
ITAB = IT_ZPPR2
* 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.Hi,
In smartform you have declared as below,
yes, like this
ITAB LIKE ZPPR2
under Tables tab in Form Interface
Then why in program,
TYPES : BEGIN OF TY_FINAL,
WERKS TYPE ZPPR2-WERKS, "PLANT
MATNR TYPE ZPPR2-MATNR, "MATERIAL
MENGE TYPE ZPPR2-MENGE, "QTY
END OF TY_FINAL.
DATA : IT_ZPPR2 TYPE TABLE OF TY_FINAL WITH HEADER LINE,
WA_ZPPR2 TYPE TY_FINAL.
declare IT_ZPPR2 same in program and smartform both.
declare in program as,
DATA : IT_ZPPR2 type table of ZPPR2 ,
WA_ZPPR2 TYPE zpr2.
Hope above will solve your problem. -
Hi, search help -- restricted value
hi
there is already a search help for a field in one of the transaction codes in fico. i think this search help is attached in code by writing match code syntax.
but my prob is that this search help for the particular field shows 10 char and out of this 10 char i need to show only 5 char from 3 to 7 when the user press f4.
eg. 1234567890 i need to show 34567 only without changing the se38 code.
when user press f4 he gets lots of records and all records should show 5 char only, now it is showing 10 char.
is it possible, if yes, then how???
pl can anybody help me.
thanx
rockyHi rocky,
You can do like this.
Use the below logic with your table, you will get as desired,
DATA: BEGIN OF gt_matnr OCCURS 0,
matnr TYPE mara-matnr,
END OF gt_matnr,
BEGIN OF gt_list OCCURS 0,
field1(5) TYPE c,
END OF gt_list.
PARAMETERS: p_matnr TYPE mara-matnr.
INITIALIZATION.
SELECT matnr
FROM mara
INTO TABLE gt_matnr.
LOOP AT gt_matnr.
gt_list-field1 = gt_matnr(5).
APPEND gt_list.
ENDLOOP.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_matnr.
CALL FUNCTION 'POPUP_WITH_TABLE'
EXPORTING
endpos_col = 30
endpos_row = 20
startpos_col = 10
startpos_row = 10
titletext = 'Select MATNR'
IMPORTING
choice = p_matnr
TABLES
valuetab = gt_list
EXCEPTIONS
break_off = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF. -
Smart forms Error - Form does not exist
Hi,
I have created a smart form and activated without any inconsistancies. SE38 code has been done properly and activated.
While executing the forms an error has raised saying 'Form does not exist'.
Could anyone suggest me what is the route cause for this error?
Regards,
Arundathi.Hi
Have you designed the smartform in SMARTFORMS tcode?
after writing the code
see the steps and check once again
How to create a New smartfrom, it is having step by step procedure
http://sap.niraj.tripod.com/id67.html
step by step good ex link is....
http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
Here is the procedure
1. Create a new smartforms
Transaction code SMARTFORMS
Create new smartforms call ZSMART
2. Define looping process for internal table
Pages and windows
First Page -> Header Window (Cursor at First Page then click Edit -> Node -> Create)
Here, you can specify your title and page numbering
&SFSY-PAGE& (Page 1) of &SFSY-FORMPAGES(Z4.0)& (Total Page)
Main windows -> TABLE -> DATA
In the Loop section, tick Internal table and fill in
ITAB1 (table in ABAP SMARTFORM calling function) INTO ITAB2
3. Define table in smartforms
Global settings :
Form interface
Variable name Type assignment Reference type
ITAB1 TYPE Table Structure
Global definitions
Variable name Type assignment Reference type
ITAB2 TYPE Table Structure
4. To display the data in the form
Make used of the Table Painter and declare the Line Type in Tabstrips Table
e.g. HD_GEN for printing header details,
IT_GEN for printing data details.
You have to specify the Line Type in your Text elements in the Tabstrips Output options.
Tick the New Line and specify the Line Type for outputting the data.
Declare your output fields in Text elements
Tabstrips - Output Options
For different fonts use this Style : IDWTCERTSTYLE
For Quantity or Amout you can used this variable &GS_ITAB-AMOUNT(12.2)&
5. Calling SMARTFORMS from your ABAP program
REPORT ZSMARTFORM.
Calling SMARTFORMS from your ABAP program.
Collecting all the table data in your program, and pass once to SMARTFORMS
SMARTFORMS
Declare your table type in :-
Global Settings -> Form Interface
Global Definintions -> Global Data
Main Window -> Table -> DATA
Written by : SAP Hints and Tips on Configuration and ABAP/4 Programming
http://sapr3.tripod.com
TABLES: MKPF.
DATA: FM_NAME TYPE RS38L_FNAM.
DATA: BEGIN OF INT_MKPF OCCURS 0.
INCLUDE STRUCTURE MKPF.
DATA: END OF INT_MKPF.
SELECT-OPTIONS S_MBLNR FOR MKPF-MBLNR MEMORY ID 001.
SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.
MOVE-CORRESPONDING MKPF TO INT_MKPF.
APPEND INT_MKPF.
ENDSELECT.
At the end of your program.
Passing data to SMARTFORMS
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = 'ZSMARTFORM'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = FM_NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
if sy-subrc <> 0.
WRITE: / 'ERROR 1'.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
call function FM_NAME
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
GS_MKPF = INT_MKPF
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.
for Smartforms material
http://www.sap-basis-abap.com/sapsf001.htm
http://www.sap-press.com/downloads/h955_preview.pdf
http://www.ossincorp.com/Black_Box/Black_Box_2.htm
http://www.sap-img.com/smartforms/sap-smart-forms.htm
http://www.sap-img.com/smartforms/smartform-tutorial.htm
http://www.sapgenie.com/abap/smartforms.htm
How to trace smartform
http://help.sap.com/saphelp_47x200/helpdata/en/49/c3d8a4a05b11d5b6ef006094192fe3/frameset.htm
http://www.help.sap.com/bp_presmartformsv1500/DOCU/OVIEW_EN.PDF
http://www.sap-img.com/smartforms/smart-006.htm
http://www.sap-img.com/smartforms/smartforms-faq-part-two.htm
Re: Need FAQ's
check most imp link
http://www.sapbrain.com/ARTICLES/TECHNICAL/SMARTFORMS/smartforms.html
<b>step by step good ex link is....
http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html</b>
Subtotals - Check the link...
Re: Subtotal with Table Node in smartforms
<b>Reward points for useful Answers</b>
Regards
Anji -
How to display internal table or DDIC data into Form
Hi
can anybody help me that how can i show the field data from internal table or DDIC into SAPscript form.
Pls let me know the example of both se38 code and text element screen.Why cant u refer a standard sapscript program.
refer form RVORDER01
in SE38 refer program RVADOR01
Thi sis simple example.
DATA: IT_INVOICEDETAIL LIKE TABLE OF ZINVOICEDETAIL WITH HEADER LINE.
DATA: TOTAL LIKE ZINVOICEDETAIL-AMOUNT,
CARRY LIKE ZINVOICEDETAIL-AMOUNT.
SELECT * FROM ZINVOICEDETAIL INTO TABLE IT_INVOICEDETAIL.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
FORM = 'ZDEMO1'.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'HEAD'
FUNCTION = 'SET'
TYPE = 'TOP'
WINDOW = 'MAIN'.
LOOP AT IT_INVOICEDETAIL.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'BOX'
WINDOW = 'MAIN'.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'ITEM'
WINDOW = 'MAIN'.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'SUMMARY'
FUNCTION = 'SET'
TYPE = 'BOTTOM'
WINDOW = 'MAIN'.
ENDLOOP.
CALL FUNCTION 'CLOSE_FORM'.
In SE71 form u have to create the text element.
BOX, ITEM,SUMMARY.
/E ITEM.
P1 &IT_INVOICEDETAIL-TOTAL& -
Dynamic display fields in Adobe Form
Hi all,
I am trying to design a Adobe non-interactive form.
But my requirement is If Field = X then display table1.
If Field = then do not display table 1 in output of Adobe form.
Field & table both are coming from SE38 code.
Please guide me if it is possible or not with a single adobe form.
Other option I have I can design 2 different form one with table & other with no table.
Please guide me if it is possible with one Adobe form or not.
RegardsHi Umesh,
This is possible using single Adobe form only. Pass this field into context.
And in form, write the script on Form:Ready event of body page:
if ( $.FIELD eq "X" ) then
$.Table1.presence = "hidden"
endif
Hope this helps,
Amit -
Can we design a table control inside a tabstrip.I have been learning the various options,but am not able to find the exact sequence of events for writing the code.
Please send me any zcode / pdf which could solve my doubt.hi shena,
I will send a sample code for creating a table control in tabstrip..check it once. i will send SE38, SE51 CODE.
SE38 CODE:
*& Module pool YMODULEPOOL_TABCTRLTABSTRIP *
*& DEVELOPER : KIRAN KUMAR.G *
*& PURPOSE : PLACING TABLE CONTROL IN TABSTRIPS *
*& CREATION DT : 18/12/2007 *
*& T.CODE : YMODTABCTRLTABS *
*& REQUEST : ERPK900035 *
PROGRAM YMODULEPOOL_TABCTRLTABSTRIP.
Tables
tables :
yvbak, "Sales Document: Header Data
yvbap. "Sales Document: Item Data
Controls
controls: my_tab type tabstrip, "For Tabstrips
my_table type tableview using screen 110.
Internal Table
*Item Data.
data: begin of gt_item occurs 0,
vbeln like vbap-vbeln,
posnr like vbap-posnr,
matnr like vbap-matnr,
matkl like vbap-matkl,
arktx like vbap-arktx,
cflag, "Deletion Flag
end of gt_item.
*Header Data
data: begin of gt_head occurs 0,
vbeln like vbak-vbeln,
erdat like vbak-erdat,
auart like vbak-auart,
vkorg like vbak-vkorg,
vtweg like vbak-vtweg,
cflag,
end of gt_head.
Global Variables
*Table Control(MY_TABLE)
data: gv_number like sy-dynnr, "Screen Number
gv_mode type c value 'D', "C:Change D:Display
gv_temp type i, "Temporary Variable
gv_lines type i. "NO.OF Records in the Table
*& Module STATUS_0100 OUTPUT
text
module STATUS_0100 output.
SET PF-STATUS 'ZTAB'.
endmodule. " STATUS_0100 OUTPUT
*& Module active_tab OUTPUT
text
module active_tab output.
*Default Active Tab Selection.
if my_tab-activetab is initial.
my_tab-activetab = 'INFO'.
gv_number = '0110'.
endif.
endmodule. " active_tab OUTPUT
*& Module copy_data1 OUTPUT
text
module copy_data1 output.
*Read the data from the Internal Table and place them in Table control
read table gt_item index my_table-current_line.
if sy-subrc eq 0.
gt_item-vbeln = gt_item-vbeln.
gt_item-posnr = gt_item-posnr.
gt_item-matnr = gt_item-matnr.
gt_item-matkl = gt_item-matkl.
gt_item-arktx = gt_item-arktx.
endif.
endmodule. " copy_data1 OUTPUT
*& Module copy_dat OUTPUT
text
module copy_dat output.
refresh : gt_item.
select vbeln
posnr
matnr
matkl
arktx
from yvbap
into table gt_item
where vbeln = vbak-vbeln.
if sy-subrc eq 0.
describe table gt_item lines gv_lines.
my_table-lines = gv_lines + 20.
endif.
endmodule. " copy_dat OUTPUT
*& Module USER_COMMAND_0100 INPUT
text
module USER_COMMAND_0100 input.
case sy-ucomm.
when 'INFO'.
my_tab-activetab = 'INFO'.
gv_number = '0110'.
when 'EXIT' or 'CANCEL'.
call transaction 'SESSION_MANAGER'.
endcase.
endmodule. " USER_COMMAND_0100 INPUT
*& Module USER_COMMAND_0110 INPUT
text
module USER_COMMAND_0110 input.
case sy-ucomm.
*Insert New Record
when 'INSE'.
*NO.OF Recors in the Internal Table
describe table gt_item lines gv_lines.
read table gt_item index my_table-current_line.
gv_temp = gv_temp + 1.
if gv_temp gt gv_lines.
*Insert Record into Internal Table
insert table gt_item.
*Insert Record into Database Table
insert into yvbap values gt_item.
endif.
*Save the Data
when 'SAVE'.
*Modify Data in the Internal Table
modify gt_item index my_table-current_line.
if sy-subrc eq 0.
*Modify Data in the Database Table
modify yvbap from table gt_item.
endif.
*Delete the Record
when 'DELE'.
if gt_item-cflag = 'X'.
*Delete the Record from the Database Table
delete from yvbap where vbeln = gt_item-vbeln
and posnr = gt_item-posnr
and matnr = gt_item-matnr
and matkl = gt_item-matkl
and arktx = gt_item-arktx.
*Delete the Record from the Internal Table
delete gt_item index my_table-current_line.
endif.
endcase.
endmodule. " USER_COMMAND_0110 INPUT
*& Module clear_data OUTPUT
text
module clear_data output.
*Clear the data when ever u enter into Table Control
clear gv_temp.
endmodule. " clear_data OUTPUT
*& Module clear_data1 OUTPUT
text
module clear_data1 output.
clear gv_temp1.
endmodule. " clear_data1 OUTPUT
SE51 CODE(SCREEN 100)
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
*Initial TabStrip Selection
MODULE active_tab.
*Placing Table Control data in Internal Table
module copy_dat.
*Display Mode
*calling subscreen
call subscreen subs including sy-cprog gv_number.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.
call subscreen subs.
SE51(SCREEN 110)
PROCESS BEFORE OUTPUT.
MODULE STATUS_0110.
loop at gt_item with control my_table cursor my_table-current_line.
module copy_data1.
endloop.
*CLEAR the Temporary variable value
module clear_data.
PROCESS AFTER INPUT.
*Populate data into internal Table
loop at gt_item.
MODULE USER_COMMAND_0110.
endloop.
Award points if helpful.
kiran kumar.G
Have a Nice Day.... -
How to code with tab strip control in se38
HI masters,
In SE38 i created tab strips with 4 tabs in selection screen. Each selection screen having 4 or 5 input fields.So whenever user click on first screen he will fill the input on that screen, and based on that fields only he will get information. Each tab is totally differ from other tabs, i mean first tab is orders and second is invoice like that. so there is no connection betwen tabs data. Everything is individual tabs.
I dont know how to code that.Can you plz help me how to code that? Thanks in advance.Its very urgent.To create a tabstrip control area, choose Tabstrip control from the object list in the Screen Painter and
place it on the screen. Fix the top-left hand corner of the table control area, and then drag the object to
the required size.
Assign a name to the tabstrip control in the Object name attribute. You need this name to identify your
tabstrip control.
In your ABAP program use the CONTROLS statement to declare an object with the same name. Use
TABSTRIP as the type.
The type TABSTRIP is defined in the type pool CXTAB. The field ACTIVETAB contains the function
code of the tab title of the currently active tabstrip. The other fields are reserved for internal use.
The default number of tab pages for a tabstrip control is two.
Technically, tab titles are treated in the same way as pushbuttons. They have a name, a text, a function
code, and a function type. You enter these in the Name, Text, FctCode and FctType fields of the object
attributes.
A tab title can have the function type ' ' (space) or 'P'. If the function type is ' ' (space), the PAI
processing block is triggered when the user chooses that tab, and the function code of the tab title is
placed in the command field. If the function type is 'P', the user can scroll between different tab pages of
the same type without triggering the PAI processing block. For further details, see the following pages.
If you want your tabstrip control to have more than two pages, you must create further tab titles. To do
this, choose Pushbutton from the object list in the Screen Painter and place it in the tab title area.
You must assign a subscreen area to each tab page.
The subscreen area assigned to a tab page is automatically entered as the Reference object (in the
Dictionary attributes) for the tab title of that page.
To assign a subscreen area to one or more tab pages, choose the relevant tab title in the fullscreen
editor, choose the Subscreen object, and place it on the tab page.
Alternatively, you can assign a single subscreen area to several tab pages by entering the name of the
subscreen area directly in the Reference object field of the attributes of the relevant tab pages.
If you have assigned a different subscreen area to each page element in a tabstrip control, you can
scroll between the pages locally at the front end.
To do this, you must send all of the subscreens to the front end when you send the main screen itself. All
of the tab titles in the tabstrip control must also have function type 'P'.
Now, when you scroll between the different page elements, there is no communication between the
presentation server and the application server.
When the user chooses a function on the screen that triggers PAI processing, the system processes the
PAI blocks of all of the subscreens as well. This means that all of the field checks are run. In this
respect, you could regard the tabstrip control as behaving like a single large screen.
Local scrolling in tabstrip controls is more appropriate for display transactions.
<b>Screen Painter:</b>
<b>PROCESS BEFORE OUTPUT.</b>
CALL SUBSCREEN subarea1
INCLUDING SY-CPROG '0101'.
CALL SUBSCREEN subarea2
INCLUDING SY-CPROG '0102'.
CALL SUBSCREEN subarea3
INCLUDING SY-CPROG '0103'.
<b>PROCESS AFTER INPUT.</b>
CALL SUBSCREEN subarea1.
CALL SUBSCREEN subarea2.
CALL SUBSCREEN subarea3.
<b>ABAP:
CONTROLS: my_tab_strip TYPE TABSTRIP.</b>
To program a tabstrip control to scroll locally at the front end, you must:
Assign
a separate subscreen area to each tab page; a subscreen will be sent to each of these
when the screen is processed.
Call
all of the subscreens from the flow logic.
Assign
function code type 'P' to all of the tab titles.
The system hides any page element whose subscreen contains no elements that can be displayed.
If there are no page elements containing elements that can be displayed, the system hides the entire
tabstrip control.
Hope this is helpful, Do reward. -
Retrieve the Object Code in se38
Hi,
I have devoloped a report in se38 and saved in a Request.
I was actually intending in chaging the code by calling into another program.Unfortunately the code was been overwritten and i am not able to see the old code.
Even i tried to get the old version by version management.
Please sugget me how i can retrieve the code.
FYI, all the custom FM and all the structures were been visible which was been used in the main prog.
Kindly suggest.
Thanks,
TayiHi Ravi,
I have devoloped a program in se38 and when i tired to submit the output of the program in PDF and then later to be sent it the same to mail using the code in
https://wiki.sdn.sap.com/wiki/display/Snippets/Send%20email%20in%20background%20-PDF%20output%20of%20the%20any%20report
and my program was replaced with another code in the above link and below is the replaced code.
REPORT ZR_SYSTEM_MONITOR .
INCLUDE zrep_print .
*IF flag ne 'X' AND Sy-subrc eq 0 .
SUBMIT ZR_SYSTEM_MONITOR
TO SAP-SPOOL SPOOL PARAMETERS print_parameters
*ARCHIVE PARAMETERS archi_parameters RETURN.
SELECT rqident FROM tsp01
INTO gd_spool_nr WHERE rq2name = print_parameters-plist .
*export gd_spool_nr to MEMORY ID 'SPOOLNO' .
*ENDIF .
Can anyone help me out how i can retrieve the old code.
1) I havent released the task .
2)also through the version management but not been able to get.
Thanks,
Anjani
Maybe you are looking for
-
Why can't I print just a selection of an Apple Mail message?
I have a MacBook running OS 10.5.8 (with the latest updates). My preferred browser is Firefox 15.0.1. I have always been able to print just a selection of a document, and I can do so in Microsoft Word, Google Mail, everything, it seems except Apple M
-
Funny Characters in Mail 2.1.2
I have been writing back and forth to my cousin in Quebec (I live in California). When he receives my messages this funny character appears after the end of each sentence following the punctuation. It is a solid black diamond with a white question ma
-
Can firefox show bookmarks list in alphabetical order like Internet Explorer?
I don't want to have to go to "show all bookmarks" then search for a bookmark. I want to just see the list and go down to the right one, or start typing it and go to it.
-
Software update with OSX 10.8 Mountain Lion
Recently I upgraded my software to Mountain Lion 10.8, and since, I have been unable to update software such as iPhoto, as it says that it is "unavailable in your country (the U.S.)." Any suggestions on what I can do here?
-
We receive an OutOfMemoryException from JServ and a blank http response during high usage. What is the proper configuration change? [03/07/2002 11:55:49:691] (EMERGENCY) ajp12[1]: cannot scan servlet headers (500) [03/07/2002 11:55:49:691] (ERROR) an