Sy-tabix for internal table in smartform
Hi friends,
How to capture the sy-tabix value for the entries in an internal table which has been looped into the loop of table node of a smartform?? I need to print something immedaitely after the end of the table
For every record the value of sy-tabix is showing 1 !!
Advance Thanks
Aadarsh
Hi Aadarsh,
Give ur sy-tabix at the end of the loop.
loop at itab.
//table node populations.
endloop.
give a seperate loop for this.
loop at itab.
sy-tabix.
endloop
get the total no and print it after the table.
If u r using do loop then give sy-index.
Hope tihs helps u,
Regards,
Nagarajan.
Message was edited by: Nagarajan Kumarappan
Similar Messages
-
How to Define Internal Table in Smartform
Hello,
I have some problem on define Internal Table in Smartform
I define a Temp_IT_Gen Type LBBIL_IT_GEN in Global Definiations
but i find that it is not available for me to append data into it,
the error message is Temp_IT_Gen is not a Internal Table - the Occurs n Specification is missing
so how can i solve it?
i want to use the internal table in the hold program.
Thanks a lot in advance.Hi,
First U define the Table type in 'TYPES' tab of Global Definitions and then assing that table type to Internal table in 'Global Data' tab.
Eg:
define the Table Type like below in TYPES tab.
TYPES:BEGIN OF ty_TEMP.
INCLUDE STRUCTURE XXXXXXX.
TYPES:END OF ty_TEMP.
TYPES: g_t_temp TYPE STANDARD TABLE OF ty_TEMP .
Now, define the Internal table in Global Data tab like below:
Variable Name Type assignment Associated Type
G_T_ITEM_1 TYPE G_T_TEMP
NOTE: whatever U define in Global Definitions can be used only in SMARTFORM, if u want to use it in Program U must define in Form Interface.
Hope it helps!!
Rgds,
Pavan -
Passing internal tables into smartforms
Hi All,
I am testing a smartform for PO. But the smartform is already designed and it has two internal tables of type EKKO and EKPO. When i run the smartform its displaying the layout correctly but with no data ,which is true as the two internal tables have no data. So i want to fill those two internal tables based on the purchase order number/ numbers. So that i can test the smartform with those purchase order numbers.
I want to create a parameter / select option in smartform so that when we enter the PO number those internal tables will be filled. How to create those options in the smartform.
If i have to create through an ABAP program then i want to know how to pass those two internal tables to smartform. (Shall i have to call the FM couple of times and then pass those two internal tables).
Thanks in AdvanceYou fill the tables in the print program and pass the tables to the SmartForm function module under the tables section. See the FM call below (CALL FUNCTION lf_fm_name) and note that I am only passing in one internal table. If you wish you may pass in more than one table.
*& Form smartform_print
* text
* --> p1 text
* <-- p2 text
FORM smartform_print .
DATA: lf_fm_name TYPE rs38l_fnam.
DATA: ls_control_param TYPE ssfctrlop.
DATA: ls_composer_param TYPE ssfcompop.
DATA: ls_recipient TYPE swotobjid.
DATA: ls_sender TYPE swotobjid.
DATA: lf_formname TYPE tdsfname.
DATA: ls_addr_key LIKE addr_key.
PERFORM set_print_param USING ls_addr_key
CHANGING ls_control_param
ls_composer_param
ls_recipient
ls_sender
retcode.
*Get the Smart Form name.
IF NOT tnapr-sform IS INITIAL.
lf_formname = tnapr-sform.
ELSE.
MESSAGE e001(/smb40/ssfcomposer).
ENDIF.
IF vbdkr-vkorg = '0035'.
IF w_regio = 'QC'.
tnapr-fonam = 'ZPCC_INVOICE_FR'.
ENDIF.
ENDIF.
* IF NOT tnapr-sform IS INITIAL.
* lf_formname = tnapr-sform.
* ELSE.
* MESSAGE e001(/smb40/ssfcomposer).
* ENDIF.
* determine smartform function module for invoice
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING formname = lf_formname
* variant = ' '
* direct_call = ' '
IMPORTING fm_name = lf_fm_name
EXCEPTIONS no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
* error handling
retcode = sy-subrc.
IF sy-subrc = 1.
MESSAGE e001(/smb40/ssfcomposer).
ENDIF.
IF sy-subrc = 2.
MESSAGE e002(/smb40/ssfcomposer).
ENDIF.
PERFORM protocol_update.
ENDIF.
CALL FUNCTION lf_fm_name
EXPORTING
archive_index = toa_dara
* ARCHIVE_INDEX_TAB =
archive_parameters = arc_params
control_parameters = ls_control_param
* MAIL_APPL_OBJ =
mail_recipient = ls_recipient
mail_sender = ls_sender
output_options = ls_composer_param
user_settings = ' '
vbdkr = vbdkr
temp_jmval = temp_jmval
temp_agval = temp_agval
w_ship = w_ship
w_ktgrd = w_ktgrd
likp = likp
w_trlrnbr = w_trlrnbr
w_sealnbr = w_sealnbr
w_booknbr = w_booknbr
w_lc = w_lc
w_shippoint = w_shippoint
billto_fedid = billto_fedid
soldto_fedid = soldto_fedid
shipto_fedid = shipto_fedid
vbco3 = vbco3
w_z4_address = w_z4_address
w_stawn = w_stawn
w_herkl = w_herkl
new_rate = new_rate
vblkp = vblkp
TABLES
vbdpr = tvbdpr
* t_containers = t_containers
* tdomvd = tkomvd
* da_xfplt = da_xfplt
* payment_split = payment_split
* komk = komk
* frt_conditions = frt_conditions
* IMPORTING
* DOCUMENT_OUTPUT_INFO =
* JOB_OUTPUT_INFO =
* JOB_OUTPUT_OPTIONS =
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5
IF sy-subrc <> 0.
retcode = sy-subrc.
PERFORM protocol_update.
* get SmartForm protocoll and store it in the NAST protocoll
PERFORM add_smfrm_prot.
ENDIF.
ENDFORM. " smartform_print
Davis -
Issue in display format of a internal table in SMARTFORM
I m printing an internal table in smartform.when a particular field exceeds the coloumn's length.the rest of the texts come down to the next line.It can be shown in the below example.i m printing "+ text to be printed" in that particular coloumn.
Because of the size of the coloumn in table ,"ed." comes down as shown.
+ text to be print
ed.
I dont want ed to come directly down '+'.I want it to start from where 't' of 'text'
starts in the above line.
Notice that the requirement is to print "ed" after '4' spaces.
Please suggest what i need to do to get the desired result...
Regards
RudraUnfortunately there is no such way.
-
Issue in display format of internal table in smartform
I m printing an internal table in smartform.when a particular field exceeds the coloumn's length.the rest of the texts come down to the next line.It can be shown in the below example.i m printing "+ text to be printed" in that particular coloumn.
Because of the size of the coloumn in table ,"ed." comes down as shown.
<b>+ text to be print
ed. </b>
its coming by default.
I want it like <b>+ text to be print
ed</b>
I dont want ed to come directly down '+'.I want it to start from where 't' of 'text'
starts in the above line.
Notice that the requirement is to print "ed" after '2' spaces.And we can not use the string length concept bcoz not of characters after which the line comes down is not fixed.May be some change of setting in smartform will do the trick.
Please suggest what i need to do to get the desired result...
Regards
RudraUnfortunately there is no such way.
-
Declaring an internal table in smartform
hi,
can anyone tell how to declare internal table in smartform.
the internal table contains fields from 2 or more data dictionary tables(eg.kna1
and adrc). after this from the print program(internal table containing data in print
program) internal table should be passed to the smartform.
thanks.hi laxya,
if u want to pass the data from internal table in print program to Smartform.. there is only way.. that is using form interface..
1. goto se11, create a structure same as the itab in the print program.ex. <b>z_itab</b>
2. create line type... se11>select radio button-DATA type><b>z_it_itab</b> >press create>then select>TABLE Type> then entrer some text--> in the line type Field in giveth Str name u have created in STEP 1. activate it.
3. got SMARTFORMS-> form inteface>tables tabe--> give some name ex <b>IT_tab type z_it_itab</b>.
then acivate it.. then in the driver progam pass this table data.
Exapmpel
CALL FUNCTION fp_v_fm_name
EXPORTING
archive_index = toa_dara
archive_parameters = arc_params
control_parameters = fp_st_control_parameters
user_settings = space
output_options = fp_st_output_options
wa_vbdkr = fp_st_vbdkr
IMPORTING
job_output_info = l_it_ssfcrescl
job_output_options = l_it_ssfcresop
TABLES
<b> IT_tab = z_it_itab (or table in driver program)</b>
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.
Another way is cteate a type in Globaldifination-->types tab..
ex:
types: begin of ty_itab,
matnr type matnr,
meins type meins
vrkme type vrkme,
end of ty_itab,
ty_it_itab type standard table of ty_itab.
then GLOBAL DIFINATION>GLOBAL DATA TAB>IT)ITAB TYPE TY_IT_ITAB.
BUT In this u can't pass the data from the print Program.. if u want to populate data in to this table... u have to write the Select query in the GLOBAL DIFINATIONS-->INITILIZATIONS TAB.
Please Close this thread.. when u r problem is solved
Reward if Helpful
Regards
Naresh Reddy K
Message was edited by:
Naresh Reddy -
Why using workarea for internal table is better in performance
Please tell me
why using workarea for internal table is better in performanceHi Vineet ,
Why would we choose to use an internal table without a header line when it is easier to code one with a header line?
it has following reason.
1)Separate Internal Table Work Area:
The work area (staging area) defined for the internal table is not limited to use with just one internal table.
take ex-
Suppose you want two internal tables for EMPLOYEE one to contain all records and one to contain only those records where country = USA. You could create both of these internal tables without header lines and use only one work area to load data into both of them. You would append all records from the work area into the first internal table. You would conditionally append the USA records from the same work area into the second internal table.
2) Performance Issues: Using an internal table without a header line is more efficient than one with a header line
3) Nested Internal Tables: If you want to include an internal table within a structure or another internal table, you must use one without a header line.
If this one is helpful ,then rewards me
Regards
Shambhu -
System Variable For Internal table count
Can anybody tell me what the system variable for internal table count?
I just wants to know how many recoreds are there in my internal table ?
Regards,
pandu.Hi ,
DESCRIBE TABLE <itab> [LINES <l>] [OCCURS <n>] [KIND <k>].
If you use the LINES parameter, the number of filled lines is written to the variable <lin>. If parameter, the you use the OCCURS value of the INITIAL SIZE of the table is returned to the variable <n>. If you use the KIND parameter, the table type is returned to the variable <k>: T for standard table, S for sorted table, and H for hashed table.
using variable
SY-TFILL
After the statements DESCRIBE TABLE, LOOP AT, and READ TABLE, SY-TFILL contains the number of lines in the relevant internal table.
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3798358411d1829f0000e829fbfe/content.htm
<REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Feb 21, 2008 4:53 PM -
Aggregate functions for internal table.
Hi Gurus,
I'm just wondering whether we can use aggregate functions for internal table. I wanted to know the max value for a particular column in my internal table. How can I achieve this easily and quickly.
Thanks,
David.sort the table on which you want the maximum value and read it. Please find below example code.
TYPES : BEGIN OF ty_mvke,
matnr TYPE mvke-matnr,
vkorg TYPE mvke-vkorg,
vtweg TYPE mvke-vtweg,
AUMNG type mvke-AUMNG,
END OF ty_mvke.
DATA : wa_mvke TYPE ty_mvke,
it_mvke TYPE STANDARD TABLE OF ty_mvke.
data : temp_AUMNG type AUMNG.
START-OF-SELECTION.
SELECT matnr vkorg vtweg AUMNG FROM mvke INTO
table it_mvke.
sort it_mvke by AUMNG.
read TABLE it_mvke into wa_mvke INDEX 1.
if sy-subrc = 0.
move wa_mvke-AUMNG to temp_AUMNG.
write : temp_AUMNG.
endif.
Thanks,
Sreekala. -
How to Import customized internal table to smartform from Print Program
Hi Gurus,
I want to Import customized internal table to smartform from print program, Can anybody tell me how it is possible.
With regards,
S.SaravananThere is no problem passing an internal table to a smarforms, smartforms have the same interface as a function module ([Defining the Form Interface|http://help.sap.com/saphelp_nw70/helpdata/en/1c/f40c5bddf311d3b574006094192fe3/frameset.htm] in [Smart Forms|http://help.sap.com/saphelp_nw70/helpdata/en/a5/de6838abce021ae10000009b38f842/frameset.htm]) so could you elaborate a little more on your requirement (is it a standard a custom forms, etc.)
Regards,
Raymond -
Regd Wagetype and basic pay from 0008 thru internal table in smartform..
Hi,
I have a requirement where i have to display in my smartform the values for basic pay and different wagetypes from infotype 0008. In my smartform for 1 employee, only those values of wagetype and basic pay should print which are maintained in 0008. If no value then it should not display in my smartform at all (No even like 0.00).
For this i have made an internal table in my smartform. Plesae advice how can i pass these vales in my smartform.
Note* - There is a filed in my custom inftyope 9003 - "Salary details as on (P9003-ZZDATE1). The value for basic pay and wagetype should be less than or equal to this date.Hello Preethi,
From your thread ,what i understood is that you have created a able in the smartform.right?You can loop this table and put a condition for checking whether there any records in the internal table.
Hope this will help you !!!
Reward points if it found useful!!
Regards,
Manoj. -
How to call Subroutines,Standard Text & using Internal Table in SmartForm
Hi all,
need help in the following areas.Its very urgent!
1.How to CAll Subroutines in Smart Forms
2.How to CAll Standard Text in Smart Forms
Situation:
We have an Internal Table T_SALES with all the data which am going to display in the smartform,How to retrive data from an internal table in Smart forms
Any Help in this direction would be highly appreciated.
Regards
RamuHi,
When you are using quantity or currency fields, you have to mentiong the reference fileds in a tab called CURRENCY/QUANTITY FILEDS in the GLOBAL DATA node.
Specifying a Currency or Quantity Reference
Use
In the ABAP Dictionary, you can assign a currency or quantity field to a table field. In the output of these fields, the system can then insert the relevant currency or unit:
· If the value field is in the same table as the corresponding currency or quantity field, the system recognizes the reference automatically, and formats the value field according to the currency or unit in the assigned field.
· If the value field is in a different table from the currency or quantity field, the system cannot recognize this reference automatically.
In the second case, you must indicate this reference to the system in the form, to ensure that the value field is formatted correctly.
Procedure
You want to assign a currency or quantity field in one table (for example, CURTAB) to a value field in another table (for example, VALTAB).
1. Create the reference to the currency field by entering the following values:
- Field Name: VALTAB-VALUE, if this is the value field of VALTAB that you want to display.
- Reference Field: CURTAB-CURRENCY, which is the currency field of CURTAB.
2. Under Data Type, specify whether the data type is a currency or quantity.
Result
In the output of the PDF-based print form, the system formats the value field VALTAB-VALUE according to the assigned value in the currency or quantity field of the global variable CURTAB-CURRENCY.
Thanks and Regards,
Bharat Kumar Reddy.V
Message was Added by: Bharat Reddy V
Message was Added by: Bharat Reddy V -
PASSING INTERNAL TABLE IN SMARTFORM
HI' I M NEW TO SMARTFORMS, MY PROBLEM IS =THAT
I'VE CREATED A NEW TYPE(SAY TY_BKPF) IN THE DRIVER PROGRAM.
THEN I'VE DECLARED AN INTERNAL TABLE OF THIS TYPE.
TO PASS THIS INTERNAL TABLE INTO MY SMARTFORM I'VE PASSED THE INTERNAL TABLE'S NAME INTO THE FUNCTION MODULE UNDER THE TABLES PARAMETER.
BUT I'M NOT ABLE TO UNDERSTAND AS TO WHAT TYPE SHOULD I GIVE IT IN THE FORM INTERFACE IN THE TABLES TAB.
PLZ HELP.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
Also have a look at below sample code. It will give you idea abt the same.
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
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.
Have a look at below link for more help on smart forms.
http://sap.ionelburlacu.ro/sap0/sapsf001.htm
http://help.sap.com/saphelp_erp2004/helpdata/en/a9/de6838abce021ae10000009b38f842/frameset.htm
I hope it helps.
Best Regards,
Vibha
*Please mark all the helpful answers -
Use internal table in Smartform
Hi All,
I want to use the internal table in program in smartform.
For that i have declare that table in TABLES attribute of the function module and trying to declare that table in form interface in smartform.I have created one stucture in data dictionary of same type for the associated type of that table.But it showing me error that only table types can be used as reference type for a table parameter.
Can anybody give me the solution or atleast tell me what is problem?
Thanks.Hi,
First you define an internal table in your Driver program and populate the same with the data and put it in the Export parameters.
Then, in your Smartform, in the Form interface parameter's declarations, specify the name which you gave in the Driver program ( the Left hand side name in the interface list of the Function Module ) and specify it as type of the internal table you have used in the Driver program.
Please define in the same way as mentioned and let me know how it worked for you or still any issues on this.
Thanks,
Vishnu. -
In driver program:
TYPES: BEGIN OF ty_output,
var1 TYPE c,
var2 type c,
TYPES: END OF ty_output.
DATA: gt_output TYPE TABLE OF ty_output.
how to declare this in smartforms?
ThanksHi,
You can do this in two ways....
1. If you need the interal table to be accessed globally in the smartform, you can declare the internal table in global definitions
first you need to define TYPES for the internal table in Types tab.
and this needs to be given as reference in Global Data tab for the internal table.
2. You need the internal table to be local ,then you can create a program lines node and declare the internal table as you do in the ABAP program
Hope this helps
Regards,
Sujatha
Maybe you are looking for
-
I often download tv shows on apple tv. All of a sudden, my screen does not display download options for tv shows. I can download movies no problem and the Internet connection is good. It just no longer shows options for tv shows except for my tv shoe
-
J1ID vendor excise details mandatory
Dear All is it possible to make mandatory in the fields Ecc no,PAN no,Vendor excise region,in J1id under vendor excise details is it possible in SAP standard field selection.. Regards Anand.
-
Late 2013 MBP w/Retina Battery Charging Issue since update to 10.10.2
I don't know if this is due to the update to OS X 10.10.2, or if it's just coincidence, but ever since updating, my battery has had issues charging. When I plug into an outlet, the indicator in the menubar shows that it's plugged in, light on the pow
-
Changing one color stop of a gradient with color picker
Hi. Is there a way to change just one color stop in a gradient by eyedropping a color on your art board? I know you can go to the color picker but it won't let you choose something on the canvas. Also I know I can make a swatch and drag it into the g
-
Source system creation IDoc error
Dear Experts, While creating the source system I am getting this error "IDoc type ZSDD029 could not be found", if I ignore this error the system creates source system in BI folder instead of making it in SAP folder. I have created IDoc with this name