Function module for multiple selection.
Hi
I have three parameters on selection screen 1. Process order number, 2.Order category and 3. order type.
My requirement is:
As i press F4 on order number and select one of the available orders, the other two fields should populate automatically with their correnponding values.
Is there any Function module for this purpose?
Thanks in advance,
Alok
Hi Alok..
Check this FM:
F4IF_INT_TABLE_VALUE_REQUEST
This FM is used to dsiplay values stored in an internal table as input help.
This FM is used to program our own custom help if no such input help exists in ABAP dictionary for a particular field.
The parameter VALUE_TAB is used to pass the internal table containing input values.
<b>The parameter RETFIELD is used to specify the internal table field whose value will be returned to the screen field or RETURN_TAB.
</b>
If DYNPNR,DYNPPROG and DYNPROFIELD are specified than the user selection is passed to the screen field specified in the DYNPROFIELD. If RETURN_TAB is specified the selectionis returned in a table.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = field from int table whose value will be returned
DYNPPROG = SY-CPROG
DYNPNR = SY-DYNNR
DYNPROFIELD = 'screen field'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = internal table whose values will be shown.
RETURN_TAB = internal table of type DDSHRETVAL
EXCEPTIONS
parameter_error = 1
no_values_found = 2
others = 3.
<b>reward if Helpful</b>
Similar Messages
-
Function Module for complex selection of articles ?
Hi there,
I'm working on a transaction to display material information (MM), like in MM43 but with data of other tables. I am designing the whole thing using my own screens. Unlike MM43, the user must be able to select more than one article in the first screen.
Do you know any function module or class method to do a multiple selection or articles, as the one in MM13?
Something that I can call in my PAI and that returns the range of articles/ranges of articles included and excluded in the selection?
thanksFound it:
Use function module COMPLEX_SELECTIONS_DIALOG, pass a range (internal table with sign, option, ...), optionally
indicate searchhelp. This can be used for any type of field. -
Save_text function module for multiple entries
HI friends,
Iam facing a following senario.
Iam using save text function module ie: save_text to save the sales text for the line items in va01 transaction.
Iam able save the text for single entry but iam not able to save the text for muliple entries.
EXAMPLE ;
posnr matnr
10 4000
20 3000
30 5000
40 8000
when iam saving the text iam able to save the text for only line item 40 ie: last line item.
i need to save the text for all the 4 line items.
how can i do that.
Iam writing the code in USEREXIT_SAVE_DOCUMENT.
Regards
Priyanka.Hi
please use commit after the function module call .
Hope it is helpful.
Check this link also:
Re: Changing sales item texts in userexit_save_document
Regards
Neha
Edited by: Neha Shukla on Nov 30, 2008 9:01 PM -
User exit or functional module for multiple GR of Production order.
Hi All,
I have done a enhancement in CO11N so that batches can get created in production order confirmation.
Now When I go to MIGO to do GR I have option to enter the nulitple batches against the production order.
But what I am looking for is there any exit or functional module which reads the production order and fecth batches which were created from CO11N.
Regards.Hi,
A few options:
1. User Exit - MBCF0002
2. BADi - MB_MIGO_BADI, MB_DOCUMENT_BADI
3. A Z program by calling BAPI_GOODSMVT_CREATE
Regards,
Vivek -
Standard function modules for selection from vbak/vbup/ekko/ekpo
hi experts ,
do you know if there is an existing standard function modules for selection from vbak/vbup/ekko/ekpo.
please helpHi,
for VBAK
ADSPCM_READ_VBAK Read VBAK (with SPEC2KM-data)
PRS_GET_GLOBAL_VBAK Get global structure VBAK
Regards,
Jyothi CH.
Edited by: Jyothi Chinnabathuni on Feb 23, 2009 2:46 PM -
Function module for select-options
Hi Colleagues !
Is there any function module to read select-options fields in a window ?
Thanks a lot and kind regards
PeterHi
I had this requirement as well, I came up with a workaround....
I ended up creating a Z structure EG. ZRANGESTRUC with the fields:
SIGN - CHAR1
ZOPTION - CHAR2
LOW - CHAR18
HIGH - CHAR18 (this would depend on your maximum length of field)
I had to make a ZOPTION field because option was a reserved system field.
I then declare tables in my function module pointing at ZRANGESTRUC data type.
Inside your function module declare ranges and then simply say S_MATNR[] = ZSTRUC_MATNR[] and then use the standard range inside your select statement.
I hope I understood your requirement correctly...
Edited by: Brad Gorlicki on Feb 10, 2010 9:36 PM -
How to apply List box for multiple selection of rows in ALV report ?
Hi Exprots,
1: How to apply List box for multiple selection of rows in ALV report ?
Thanking you.
Subashhi,
check the below program.
REPORT zalv_dropdowns.
*Type pools declarations for ALV
TYPE-POOLS : slis.
*data declarations for ALV container,ALV grid, Fieldcatalogues & layout
DATA: g_grid TYPE REF TO cl_gui_alv_grid,
g_custom_container TYPE REF TO cl_gui_custom_container,
gt_fieldcat TYPE lvc_t_fcat,
gs_layout TYPE lvc_s_layo.*INTERNAL TABLE AND WA DECLARATIONS FOR t517 A table
DATA: gt_outtab TYPE STANDARD TABLE OF t517a INITIAL SIZE 0,
wa_outtab TYPE t517a.
START-OF-SELECTION.*Call to ALV
CALL SCREEN 600.*On this statement double click it takes you to the screen painter SE51.
*Create a Custom container and name it CCONT and OK code as OK_CODE.
*Save check and Activate the screen painter.
*Now a normal screen with number 600 is created which holds the ALV grid.
PBO of the actual screen , Here we can give a title and customized menus
Here we also call the subroutine for ALV output.
MODULE PBO OUTPUT *
MODULE pbo OUTPUT.
PERFORM alv_output.
ENDMODULE. "pbo OUTPUT
MODULE PAI INPUT *
MODULE pai INPUT.
ENDMODULE. "pai INPUT
*& Form BUILD_FIELDCAT
FORM build_fieldcat.
DATA ls_fcat TYPE lvc_s_fcat.
*Build the field catalogue
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'T517A'
CHANGING
ct_fieldcat = gt_fieldcat.
To assign dropdown in the fieldcataogue
LOOP AT gt_fieldcat INTO ls_fcat.
CASE ls_fcat-fieldname.
WHEN 'SLART'.
*is the first list box
ls_fcat-drdn_hndl = '1'.
ls_fcat-outputlen = 15.
MODIFY gt_fieldcat FROM ls_fcat.
is the second list box
WHEN 'ABART'.
ls_fcat-drdn_hndl = '2'.
ls_fcat-outputlen = 15.
MODIFY gt_fieldcat FROM ls_fcat.
ENDCASE.
ENDLOOP.
ENDFORM. "build_fieldcat
*& Form ALV_OUTPUT
FORM alv_output .*Create object for container
CREATE OBJECT g_custom_container
EXPORTING container_name = 'CCONT'.
*create object for grid
CREATE OBJECT g_grid
EXPORTING i_parent = g_custom_container.
Build fieldcat and set column
*Assign a handle for the dropdown listbox.
PERFORM build_fieldcat.
*Build layout
PERFORM build_layout.
Define a drop down table.
PERFORM dropdown_table.
*fetch values from the T517A table
SELECT * FROM t517a INTO TABLE gt_outtab.
*Display ALV output
CALL METHOD g_grid->set_table_for_first_display
EXPORTING
is_layout = gs_layout
CHANGING
it_fieldcatalog = gt_fieldcat
it_outtab = gt_outtab.ENDFORM. "ALV_OUTPUT
*& Form dropdown_table
text
--> p1 text
<-- p2 text
FORM dropdown_table.*Declarations for drop down lists in ALV.
DATA: lt_dropdown TYPE lvc_t_drop,
ls_dropdown TYPE lvc_s_drop.
First SLART listbox (handle '1').
ls_dropdown-handle = '1'.
ls_dropdown-value = '01 Primary school'.
APPEND ls_dropdown TO lt_dropdown. ls_dropdown-handle = '1'.
ls_dropdown-value = '02 Lower Secondary'.
APPEND ls_dropdown TO lt_dropdown. ls_dropdown-handle = '1'.
ls_dropdown-value = '03 Upper Secondary'.
APPEND ls_dropdown TO lt_dropdown.
ls_dropdown-handle = '1'.
ls_dropdown-value = '04 Professional School'.
APPEND ls_dropdown TO lt_dropdown.
ls_dropdown-handle = '1'.
ls_dropdown-value = '05 College'.
APPEND ls_dropdown TO lt_dropdown.
ls_dropdown-handle = '1'.
ls_dropdown-value = '06 University'.
APPEND ls_dropdown TO lt_dropdown.
ls_dropdown-handle = '1'.
ls_dropdown-value = '09 Other Establishment'.
APPEND ls_dropdown TO lt_dropdown.* Second ABART listbox (handle '2'). ls_dropdown-handle = '2'.
ls_dropdown-value = '10 Primary School certificate'.
APPEND ls_dropdown TO lt_dropdown.
ls_dropdown-handle = '2'.
ls_dropdown-value = '20 Lower secondary/Junior high'.
APPEND ls_dropdown TO lt_dropdown. ls_dropdown-handle = '2'.
ls_dropdown-value = '30 High school diploma(B-levels)'.
APPEND ls_dropdown TO lt_dropdown.
ls_dropdown-handle = '2'.
ls_dropdown-value = '31 Vocational'.
APPEND ls_dropdown TO lt_dropdown. ls_dropdown-handle = '2'.
ls_dropdown-value = '32 Matriculation'.
APPEND ls_dropdown TO lt_dropdown. ls_dropdown-handle = '2'.
ls_dropdown-value = '40 Specialist vocational certificate'.
APPEND ls_dropdown TO lt_dropdown. ls_dropdown-handle = '2'.
ls_dropdown-value = '50 College degree Level1'.
APPEND ls_dropdown TO lt_dropdown. ls_dropdown-handle = '2'.
ls_dropdown-value = '51 College degree Level2'.
APPEND ls_dropdown TO lt_dropdown. ls_dropdown-handle = '2'.
ls_dropdown-value = '52 Masters degree'.
APPEND ls_dropdown TO lt_dropdown. ls_dropdown-handle = '2'.
ls_dropdown-value = '60 Univ Degree level1'.
APPEND ls_dropdown TO lt_dropdown. ls_dropdown-handle = '2'.
ls_dropdown-value = '61 Bachelors degree'.
APPEND ls_dropdown TO lt_dropdown. ls_dropdown-handle = '2'.
ls_dropdown-value = '62 Masters degree'.
APPEND ls_dropdown TO lt_dropdown. ls_dropdown-handle = '2'.
ls_dropdown-value = '63 Licenciate'.
APPEND ls_dropdown TO lt_dropdown. ls_dropdown-handle = '2'.
ls_dropdown-value = '64 Doctors Degree Ph.D'.
APPEND ls_dropdown TO lt_dropdown. ls_dropdown-handle = '2'.
ls_dropdown-value = '89 None'.
APPEND ls_dropdown TO lt_dropdown. ls_dropdown-handle = '2'.
ls_dropdown-value = '90 Unknown'.
APPEND ls_dropdown TO lt_dropdown.*method to display the dropdown in ALV
CALL METHOD g_grid->set_drop_down_table
EXPORTING
it_drop_down = lt_dropdown.ENDFORM. " dropdown_table
*& Form build_layout
text
*layout for ALV output
FORM build_layout . gs_layout-cwidth_opt = 'X'.
gs_layout-grid_title = 'ALV DROPDOWN LISTS'.
gs_layout-no_toolbar = 'X'.ENDFORM. " build_layout
endform.
Edited by: S.r.v.r.Kumar on Jun 1, 2009 2:48 PM -
Function Modules for uploading the file
Hi experts ,
I have a requirement to download a file (csv) from my local sytem (say desktop) into an internal table first and then update the contents of the same internal table into the database table.
Can anybody provide me with a sample program for doing the same or at least the name of function modules for the same.
Prompt replies will be rewarded.
TIA
AbhishekHi Abhishek,
How to use INSERT Statement..
Check this Sample Program..
TABLES:MARA.
DATA:ITAB LIKE MARA OCCURS 0 WITH HEADER LINE.
START-OF-SELECTION.
ITAB-MATNR = '123ABCDA'. .
ITAB-MBRSH = 'C'.
ITAB-MTART = 'FERT' .
ITAB-MEINS = 'KG' .
APPEND ITAB.
ITAB-MATNR = '123ABCDB'. .
ITAB-MBRSH = 'C'.
ITAB-MTART = 'FERT' .
ITAB-MEINS = 'KG' .
APPEND ITAB.
LOOP AT ITAB.
INSERT MARA FROM ITAB.
MODIFY MARA .
ENDLOOP. -
Function modules for the following
Hi,
I want to know the function modules for the following purposes.
1) Check whether a date is valid or not
2) Calculate the no of days between two dates.
Expecting an early response.
Thanks n Regards,
AmitHi,
PARAMETERS: p_list LIKE t009b-bumon AS LISTBOX
VISIBLE LENGTH 11 OBLIGATORY ,
p_list1 LIKE t009b-bdatj OBLIGATORY.
SELECTION-SCREEN POSITION POS_HIGH.
PARAMETERS: p_list2 LIKE t009b-bumon AS LISTBOX
VISIBLE LENGTH 11 OBLIGATORY,
p_list3 LIKE t009b-bdatj OBLIGATORY.
Calling Function Module for calculating no of days between the
selected period
CALL FUNCTION 'NUMBER_OF_DAYS_PER_MONTH_GET'
EXPORTING
par_month = p_list
par_year = p_list1
IMPORTING
par_days = ws_n_days.
CALL FUNCTION 'NUMBER_OF_DAYS_PER_MONTH_GET'
EXPORTING
par_month = p_list2
par_year = p_list3
IMPORTING
par_days = ws_n_days1.
For Concatenating the month and year into the date format
CONCATENATE p_list1 p_list ws_i INTO ws_c_date1.
CONCATENATE p_list3 p_list2 ws_n_days1 INTO ws_c_date2.
date = ws_c_date1 - ws_c_date2.
In the above sample code the selection screen has month and year as input.
Also check this link
http://www.sapdevelopment.co.uk/tips/date/datehome.htm
Check FM
<b>RP_CALC_DATE_IN_INTERVAL</b> Add/subtract years/months/days from a date
<b>SD_DATETIME_DIFFERENCE</b> Give the difference in Days and Time for 2 dates
<b>Also for checking valid date:</b>
U can specify the date field as
Select-options: s_date like likp-date(similar to ur requirement)
This itself ceck for the valid date no seperate validation needed.
Thanks & Regards,
Judith. -
Function Modules for Data and Time
Hi all,
I need 2 function modules for date and time. when we pass current data(sy-datum) and current time (sy-uzeit) into function modules, shoud get date in <b>dd/mm/yyyy or dd.mm.yyyy</b> and time in<b> HH:MM:SS</b> formats.
Thanks in advanceHi Ranjith,
i think this will b usefull for you..
SAP Bar Chart Function Modules and what they are used for
Function module
Used for
BARC_GRAPHIC_PBO
Starting bar chart at PBO time, using a graphic profile (parameter PROFILE)
BARC_GRAPHIC_PAI
Analyzing data returned by the graphic
BARC_SET_TIME_AXIS
Setting start and end of time axis
BARC_SET_OPTIONS
Setting options
BARC_ADD_CHART
Creating a chart
BARC_SET_CHART_ATTRIB
Setting chart attributes
BARC_ADD_SECTION
Creating a section on the time axis
BARC_SET_SECTION_ATTRIB
Setting section attributes
BARC_ADD_RIBBON
Adding a ribbon to the time axis
BARC_SET_RIBBON_ATTRIB
Setting attributes for ribbons in the chart
BARC_ADD_GRID
Adding a time grid
BARC_SET_GRID_ATTRIB
Setting grid attributes
BARC_ADD_LAYER
Adding a layer (graphic elements)
BARC_SET_LAYER_ATTRIB
Setting layer attributes
BARC_ADD_LINE
Adding a line
BARC_ADD_CALENDAR
Creating a calendar
BARC_SET_CALENDAR_ATTRIB
Setting attributes for a calendar
BARC_ADD_TIME_PROFILE
Creating time profiles
BARC_SET_TIME_PROFILE_ATTRIB
Setting attributes for time profile
BARC_ADD_INTERVAL
Adding a time interval
BARC_SET_INTERVAL_ATTRIB
Setting time interval attributes
BARC_ADD_TIME_OBJECT
Creating a time object
BARC_CONVERT_DATE
Creating a date string in bar chart format
BARC_REVERT_DATE
Converting a date string in bar chart format to date and time
BARC_ADD_DATELINE
Creating a date line
BARC_SET_DATELINE_ATTRIB
Setting dateline attributes
BARC_GET_PROFILE_CONTENTS
Obtaining profile contents for customizing a chart
BARC_GET_COLUMN_WIDTH
Selecting new column width
BARC_SET_COLUMN_WIDTH
Setting the column width
BARC_GET_TEXTINDEX
Obtaining the text index of a field
BARC_SET_LABELS
Positioning the chart display
BARC_SET_COLUMN_ATTRIB
Setting column attributes
BARC_SET_ROW_ATTRIB
Setting row attributes
BARC_SET_ROW_HEIGHT
Setting the line height
BARC_SET_MAXCHARTS
Setting the maximum number of charts sent
<b>If its usefull reward points
</b> -
Function Module for Job reschedule
Hello Experts,
Is there a function module for job rescheduling as i need to create a automation program where i need to select all jobs from excel sheet and reschedule at different time.
Thanks and Regards,
Nikhil Kanegaonkar.You could use the following FM
- [BP_JOB_READ|http://www.sdn.sap.com/irj/scn/advancedsearch?query=bp_job_read] (read first from TBTCO to fill field JOBCOUNT)
- [BP_JOB_CREATE|http://www.sdn.sap.com/irj/scn/advancedsearch?query=bp_job_create] (change schedule parameters first)
- for recent versions [BP_JOB_COPY|http://www.sdn.sap.com/irj/scn/advancedsearch?query=bp_job_copy]
You should take a look at FM of the FG BTCH and SAP documentation like [Programming with the Background Processing System (BC-CCM-BTC)|http://help.sap.com/saphelp_nwpi71/helpdata/en/fa/096c53543b11d1898e0000e8322d00/frameset.htm]
Regards,
Raymond -
Error in XXL_FULL_API function module for download report to excel
Hi all,
I am using XXL_FULL_API function module for download report to excel, In this FM we have to fill a table called sema = t_gxxlt_s. in this table we have a fields called
i_sema-col_no = 19.
i_sema-col_src = 19.
i_sema-col_typ = 'STR'.
i_sema-col_ops = 'DFT'
here in 'col_typ' if we put STR in excel it will come as a text but i wnat the time field what i have to pass ?
and for filed 'col_ops' also ??
Thaks,
SridharHi sridhar joshi,
Please check this program
REPORT Excel.
TABLES:
sflight.
* header data................................
DATA :
header1 LIKE gxxlt_p-text VALUE 'Suresh',
header2 LIKE gxxlt_p-text VALUE 'Excel sheet'.
* Internal table for holding the SFLIGHT data
DATA BEGIN OF t_sflight OCCURS 0.
INCLUDE STRUCTURE sflight.
DATA END OF t_sflight.
* Internal table for holding the horizontal key.
DATA BEGIN OF t_hkey OCCURS 0.
INCLUDE STRUCTURE gxxlt_h.
DATA END OF t_hkey .
* Internal table for holding the vertical key.
DATA BEGIN OF t_vkey OCCURS 0.
INCLUDE STRUCTURE gxxlt_v.
DATA END OF t_vkey .
* Internal table for holding the online text....
DATA BEGIN OF t_online OCCURS 0.
INCLUDE STRUCTURE gxxlt_o.
DATA END OF t_online.
* Internal table to hold print text.............
DATA BEGIN OF t_print OCCURS 0.
INCLUDE STRUCTURE gxxlt_p.
DATA END OF t_print.
* Internal table to hold SEMA data..............
DATA BEGIN OF t_sema OCCURS 0.
INCLUDE STRUCTURE gxxlt_s.
DATA END OF t_sema.
* Retreiving data from sflight.
SELECT * FROM sflight
INTO TABLE t_sflight.
* Text which will be displayed online is declared here....
t_online-line_no = '1'.
t_online-info_name = 'Created by'.
t_online-info_value = 'KODANDARAMI REDDY'.
APPEND t_online.
* Text which will be printed out..........................
t_print-hf = 'H'.
t_print-lcr = 'L'.
t_print-line_no = '1'.
t_print-text = 'This is the header'.
APPEND t_print.
t_print-hf = 'F'.
t_print-lcr = 'C'.
t_print-line_no = '1'.
t_print-text = 'This is the footer'.
APPEND t_print.
* Defining the vertical key columns.......
t_vkey-col_no = '1'.
t_vkey-col_name = 'MANDT'.
APPEND t_vkey.
t_vkey-col_no = '2'.
t_vkey-col_name = 'CARRID'.
APPEND t_vkey.
t_vkey-col_no = '3'.
t_vkey-col_name = 'CONNID'.
APPEND t_vkey.
t_vkey-col_no = '4'.
t_vkey-col_name = 'FLDATE'.
APPEND t_vkey.
* Header text for the data columns................
t_hkey-row_no = '1'.
t_hkey-col_no = 1.
t_hkey-col_name = 'PRICE'.
APPEND t_hkey.
t_hkey-col_no = 2.
t_hkey-col_name = 'CURRENCY'.
APPEND t_hkey.
t_hkey-col_no = 3.
t_hkey-col_name = 'PLANETYPE'.
APPEND t_hkey.
t_hkey-col_no = 4.
t_hkey-col_name = 'SEATSMAX'.
APPEND t_hkey.
t_hkey-col_no = 5.
t_hkey-col_name = 'SEATSOCC'.
APPEND t_hkey.
t_hkey-col_no = 6.
t_hkey-col_name = 'PAYMENTSUM'.
APPEND t_hkey.
* populating the SEMA data..........................
t_sema-col_no = 1.
t_sema-col_typ = 'STR'.
t_sema-col_ops = 'DFT'.
APPEND t_sema.
t_sema-col_no = 2.
APPEND t_sema.
t_sema-col_no = 3.
APPEND t_sema.
t_sema-col_no = 4.
APPEND t_sema.
t_sema-col_no = 5.
APPEND t_sema.
t_sema-col_no = 6.
APPEND t_sema.
t_sema-col_no = 7.
APPEND t_sema.
t_sema-col_no = 8.
APPEND t_sema.
t_sema-col_no = 9.
APPEND t_sema.
t_sema-col_no = 10.
t_sema-col_typ = 'NUM'.
t_sema-col_ops = 'ADD'.
APPEND t_sema.
CALL FUNCTION 'XXL_FULL_API'
EXPORTING
* DATA_ENDING_AT = 54
* DATA_STARTING_AT = 5
filename = 'TESTFILE'
header_1 = header1
header_2 = header2
no_dialog = 'X'
no_start = ' '
n_att_cols = 6
n_hrz_keys = 1
n_vrt_keys = 4
sema_type = 'X'
* SO_TITLE = ' '
TABLES
data = t_sflight
hkey = t_hkey
online_text = t_online
print_text = t_print
sema = t_sema
vkey = t_vkey
EXCEPTIONS
cancelled_by_user = 1
data_too_big = 2
dim_mismatch_data = 3
dim_mismatch_sema = 4
dim_mismatch_vkey = 5
error_in_hkey = 6
error_in_sema = 7
file_open_error = 8
file_write_error = 9
inv_data_range = 10
inv_winsys = 11
inv_xxl = 12
OTHERS = 13
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
please refer this link
http://www.thespot4sap.com/Articles/Download_to_excel.asp
Best regards,
raam -
Function module for F4 help download
HI Experts
What is the function module for F4 help download.
Thanks in advanceHi,
Function module is F4IF_FIELD_VALUE_REQUEST.
Use the Function moduel like this in this i create screen 100 by using se51.
REPORT zcl_f4_help.
TYPES: BEGIN OF values,
carrid TYPE spfli-carrid,
connid TYPE spfli-connid,
END OF values.
DATA: carrier(3) TYPE c,
connection(4) TYPE c.
DATA: progname TYPE sy-repid,
dynnum TYPE sy-dynnr,
dynpro_values TYPE TABLE OF dynpread,
field_value LIKE LINE OF dynpro_values,
values_tab TYPE TABLE OF values.
CALL SCREEN 100.
MODULE init OUTPUT.
progname = sy-repid.
dynnum = sy-dynnr.
CLEAR: field_value, dynpro_values.
field_value-fieldname = 'CARRIER'.
APPEND field_value TO dynpro_values.
ENDMODULE.
MODULE cancel INPUT.
LEAVE PROGRAM.
ENDMODULE.
MODULE value_carrier INPUT.
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = 'DEMOF4HELP'
fieldname = 'CARRIER1'
dynpprog = progname
dynpnr = dynnum
dynprofield = 'CARRIER'.
ENDMODULE.
MODULE value_connection INPUT.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = progname
dynumb = dynnum
translate_to_upper = 'X'
TABLES
dynpfields = dynpro_values.
READ TABLE dynpro_values INDEX 1 INTO field_value.
SELECT carrid connid
FROM spfli
INTO CORRESPONDING FIELDS OF TABLE values_tab
WHERE carrid = field_value-fieldvalue.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'CONNID'
dynpprog = progname
dynpnr = dynnum
dynprofield = 'CONNECTION'
value_org = 'S'
TABLES
value_tab = values_tab.
ENDMODULE.
you use this exaple code.
Plz Reward if Help,
Mahi. -
HI Experts
What is the function module for F4 help download.
Thanks in advanceHi,
try these fn modules,
F4IF_INT_TABLE_VALUE_REQUEST
its a F4 help that returns the values selected in an internal table.
F4_IF_FIELD_VALUE_REQUEST
It uses values from a DDIC table to provide a list of possible values -
Function Module for sending an Attachment
Not able to find the Function Module for sending an Attachment to the email ids.
Please help.Hi bala,
1. There is some trick involved in attachment
in the binary files.
2. I have made a program (and it works fantastic)
ONLY 6 LINES FOR EMAILING
BELIEVE ME
ITS A FANTASTIC PROGRAM.
IT WILL WORK LIKE OUTLOOK EXPRESS !
3. The user is provided with
a) file name
b) email address to send mail
and it sends ANY FILE (.xls,.pdf .xyz..)
Instantaneously !
4. Make two things first :
1. Include with the name : ZAMI_INCLFOR_MAIL
2. Report with the name : ZAM_TEMP147 (any name will do)
3. Activate both and execute (2)
4. After providing filename, email adress
5. Code for Include :
10.08.2005 Amit M - Created
Include For Mail (First Req F16)
Modification Log
Data
DATA: docdata LIKE sodocchgi1,
objpack LIKE sopcklsti1 OCCURS 1 WITH HEADER LINE,
objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE,
objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objhex LIKE solix OCCURS 10 WITH HEADER LINE,
reclist LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
DATA: tab_lines TYPE i,
doc_size TYPE i,
att_type LIKE soodk-objtp.
DATA: listobject LIKE abaplist OCCURS 1 WITH HEADER LINE.
FORM
FORM ml_customize USING objname objdesc.
Clear Variables
CLEAR docdata.
REFRESH objpack.
CLEAR objpack.
REFRESH objhead.
REFRESH objtxt.
CLEAR objtxt.
REFRESH objbin.
CLEAR objbin.
REFRESH objhex.
CLEAR objhex.
REFRESH reclist.
CLEAR reclist.
REFRESH listobject.
CLEAR listobject.
CLEAR tab_lines.
CLEAR doc_size.
CLEAR att_type.
Set Variables
docdata-obj_name = objname.
docdata-obj_descr = objdesc.
ENDFORM. "ml_customize
FORM
FORM ml_addrecp USING preceiver prec_type.
CLEAR reclist.
reclist-receiver = preceiver.
reclist-rec_type = prec_type.
APPEND reclist.
ENDFORM. "ml_customize
FORM
FORM ml_addtxt USING ptxt.
CLEAR objtxt.
objtxt = ptxt.
APPEND objtxt.
ENDFORM. "ml_customize
FORM
FORM ml_prepare USING bypassmemory whatatt_type whatname.
IF bypassmemory = ''.
Fetch List From Memory
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = listobject
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'LIST_FROM_MEMORY'.
ENDIF.
CALL FUNCTION 'TABLE_COMPRESS'
IMPORTING
COMPRESSED_SIZE =
TABLES
in = listobject
out = objbin
EXCEPTIONS
OTHERS = 1
IF sy-subrc <> 0.
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'TABLE_COMPRESS'.
ENDIF.
ENDIF.
Header Data
Already Done Thru FM
Main Text
Already Done Thru FM
Packing Info For Text Data
DESCRIBE TABLE objtxt LINES tab_lines.
READ TABLE objtxt INDEX tab_lines.
docdata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
CLEAR objpack-transf_bin.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'TXT'.
APPEND objpack.
Packing Info Attachment
att_type = whatatt_type..
DESCRIBE TABLE objbin LINES tab_lines.
READ TABLE objbin INDEX tab_lines.
objpack-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objbin ).
objpack-transf_bin = 'X'.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = att_type.
objpack-obj_name = 'ATTACHMENT'.
objpack-obj_descr = whatname.
APPEND objpack.
Receiver List
Already done thru fm
ENDFORM. "ml_prepare
FORM
FORM ml_dosend.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = docdata
put_in_outbox = 'X'
commit_work = 'X' "used from rel. 6.10
IMPORTING
SENT_TO_ALL =
NEW_OBJECT_ID =
TABLES
packing_list = objpack
object_header = objhead
contents_bin = objbin
contents_txt = objtxt
CONTENTS_HEX = objhex
OBJECT_PARA =
object_parb =
receivers = reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8
IF sy-subrc <> 0.
MESSAGE ID 'SO' TYPE 'S' NUMBER '023'
WITH docdata-obj_name.
ENDIF.
ENDFORM. "ml_customize
FORM
FORM ml_spooltopdf USING whatspoolid.
DATA : pdf LIKE tline OCCURS 0 WITH HEADER LINE.
Call Function
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = whatspoolid
TABLES
pdf = pdf
EXCEPTIONS
err_no_otf_spooljob = 1
OTHERS = 12.
Convert
PERFORM doconv TABLES pdf objbin.
ENDFORM. "ml_spooltopdf
FORM
FORM doconv TABLES
mypdf STRUCTURE tline
outbin STRUCTURE solisti1.
Data
DATA : pos TYPE i.
DATA : len TYPE i.
Loop And Put Data
LOOP AT mypdf.
pos = 255 - len.
IF pos > 134. "length of pdf_table
pos = 134.
ENDIF.
outbin+len = mypdf(pos).
len = len + pos.
IF len = 255. "length of out (contents_bin)
APPEND outbin.
CLEAR: outbin, len.
IF pos < 134.
outbin = mypdf+pos.
len = 134 - pos.
ENDIF.
ENDIF.
ENDLOOP.
IF len > 0.
APPEND outbin.
ENDIF.
ENDFORM. "doconv
CODE FOR PROGRAM
5.
REPORT zam_temp147 .
INCLUDE zami_inclfor_mail.
DATA
DATA : itab LIKE tline OCCURS 0 WITH HEADER LINE.
DATA : file_name TYPE string.
data : path like PCFILE-PATH.
data : extension(5) type c.
data : name(100) type c.
SELECTION SCREEN
PARAMETERS : receiver TYPE somlreci1-receiver lower case.
PARAMETERS : p_file LIKE rlgrap-filename
OBLIGATORY.
AT SELECTION SCREEN
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CLEAR p_file.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
file_name = p_file.
START-OF-SELECTION
START-OF-SELECTION.
PERFORM ml_customize USING 'Tst' 'Testing'.
PERFORM ml_addrecp USING receiver 'U'.
PERFORM upl.
PERFORM doconv TABLES itab objbin.
PERFORM ml_prepare USING 'X' extension name.
PERFORM ml_dosend.
SUBMIT rsconn01
WITH mode EQ 'INT'
AND RETURN.
FORM
FORM upl.
file_name = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = file_name
filetype = 'BIN'
TABLES
data_tab = itab
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
path = file_name.
CALL FUNCTION 'PC_SPLIT_COMPLETE_FILENAME'
EXPORTING
complete_filename = path
CHECK_DOS_FORMAT =
IMPORTING
DRIVE =
EXTENSION = extension
NAME = name
NAME_WITH_EXT =
PATH =
EXCEPTIONS
INVALID_DRIVE = 1
INVALID_EXTENSION = 2
INVALID_NAME = 3
INVALID_PATH = 4
OTHERS = 5
ENDFORM. "upl
regards,
amit m.
Maybe you are looking for
-
Why is my printer not recognized by my computer?
I recently replaced my apple airport extreme 3rd generation with an optimum smart router. My network is now up and running. When I plugged in my HP Photosmart C4400 series printer into the usb port for my normal wireless printing, the usb light turne
-
I have had to do a few restores to my ipod because my computer keeps crashing and my father keeps playing around with the computer. I deleted the TV shows that I had had on my ipod because there was an issue with 'the required file could not be found
-
Can anyone help me figure out the different settings? In ProTools everything is clear but in Logic I don't understand which setting that correspond to which sample rate etc ... And yes.... I've read the manuals.... 16 Tracks (1 DSP) 32 Tracks (1 DSP)
-
Hi everybody! I am looking for a free library for Java for interaction with pdf-files. My goal is to create an image-file (jpeg, bmp or gif, ...) from an exisiting pdf file, in particular from the first page, ... Any ideas? Thx in Advance! StrongStev
-
Hi All, I am facing problem with partial settlement, we are using the partial settlement process line item wise using KOB5. Mow there 5 line item which was posted in same period Now we want to settle only 3 Line item. We set the Settlement rule and w