Module pool Program table control
Hi,
In Module pool programming, table control i have 10 items out of which in the same colum i want to put them in edit mode and certain in disply mode.
Regards
Hi,
You can use loop at screen,
MODULE passdata OUTPUT.
READ TABLE it_revision INTO wa_rev INDEX tab_clc-current_line.
IF sy-subrc = 0.
LOOP AT SCREEN.
IF screen-group1 = '111'. " 111 IS THE GROUP NAME
screen-input = 1. " input mode
screen-active = 1. " input mode.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSE.
LOOP AT SCREEN.
IF screen-group1 = '111'. "GROUP NAME
screen-input = 0. " display mode
screen-active = 1. " DISPLAY MODE.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDMODULE. " PASSDATA OUTPUT
Make the group of those field ,that you want in input mode
Hope it will Solve your problem
Thanks
Arun kayal.
Similar Messages
-
Module pool program, table control edit
Hi,
I am doing module pool programming with table control. I have a table control on my screen which is assigned to scarr table with New, Modify, Save, and Delete buttons. When I click on New and Save, the new record is adding to the table where as for Modify, I selected a row, edited, and clicked on save. Only the internal table is getting modified at the time but not the original table. How to update the table in database? Delete is also not working. Please give some idea on this or links related to table control with sample code.
Thanks in advance.Hi,
modify <table name>.
it will do it
Regards -
Comparing screen input in program in module pool programming(table control)
Experts,
I am a newbie in ABAP. I am working dialog programming where I am replicating PR creation. I am asking user to enter item number, material number and plant. I am validating material number and plant using chain and endchain. This validation is working fine and it throws error message if user enters invalid input. I am able to see corresponding details (corresponding details like unit of measure, delivery date and short text etc. if values entered are correct.) when user clicks on ADD button. Now I have one problem. If user enters same item number twice it should throw error message. I am not able to figure out how it should be done. I thought to set flag = 'X' after user enters item number.
I am using table control. The validation part for material number(matnr) and plant (werks) work fine. I am getting problem while checking entered item number to check duplication.
User should not enter the same item number again.
In my structure i have defined a variable called checkflag(1) type c. and i am doing it now following way. Right now my checkflag code is commented.
Following is my snippet for the same.
Please let me know your ideas/suggestions and advices.
DATA : counter TYPE i,
itmno1 TYPE i.
SELECT SINGLE matnr
FROM mara INTO matno WHERE matnr = it_pr-matnr.
SELECT SINGLE werks
FROM t001w INTO plant WHERE werks = it_pr-werks.
SELECT SINGLE matnr werks
FROM marc INTO (matno,plant)
WHERE matnr = it_pr-matnr AND werks = it_pr-werks.
itmno1 = it_pr-bnfpo.
IF ok_code = 'ADD'.
IF it_pr-matnr <> matno OR it_pr-werks <> plant AND it_pr-bnfpo = ''.
MESSAGE 'Not a Valid material number or plant. Please enter valid values.' TYPE 'E'.
ELSEIF it_pr-matnr = matno AND it_pr-werks = plant AND it_pr-bnfpo <> ''.
SELECT SINGLE maktx FROM makt INTO stext WHERE matnr = it_pr-matnr.
SELECT SINGLE meins FROM mara INTO tmeins WHERE matnr = it_pr-matnr.
SELECT SINGLE lpein FROM eban INTO tlpein WHERE matnr = it_pr-matnr.
* if it_pr-bnfpo = itmno1.
* it_pr-checkflag = 'X'.
* endif.
READ TABLE it_pr WITH TABLE KEY
checkflag = it_pr-checkflag
bnfpo = it_pr-bnfpo
maktx = it_pr-maktx
matnr = it_pr-matnr
eindt = it_pr-eindt
meins = it_pr-meins
werks = it_pr-werks
lpein = it_pr-lpein.
* if it_pr-checkflag = 'X'.
* message 'Please enter another item number.' TYPE 'E'.
* endif.
IF sy-subrc <> 0.
it_pr-bnfpo = itmno1.
it_pr-maktx = stext.
it_pr-lpein = tlpein.
it_pr-meins = tmeins.
APPEND it_pr.
ENDIF.
IF sy-subrc = 0.
MESSAGE 'Please enter another item number.' TYPE 'E'.
ENDIF.
ENDIF.
ENDIF.Indeed thank you very much @medha24 and @gargi sarkar.
If I use current-line, I will have to skip first entry as first entry should be appended. Then only I would be able to compare it with newly entered value. I will have to use loop end loop within the PAI. I have already written this code in the validation PAI itself.
I am not getting how I should use loop endloop effectively so that control will go to the next iteration effectively. Right now with this code, I am getting partial success if I enter item number in bulk (more than one item number as input at same time). later, even though I enter correct values I get error message as it doesn't find next entry in the table. It only appends first records only. Therefore, I am looking to enter first entry without any check and later entries should be compared and appended. I would appreciate your ideas/suggestions.
Thank you.
Best reagrds. -
Sort up and sort Down push buttons in module pool with table control wizard
hi,
i have created 2 buttons for Sort up and sort Down push buttons in module pool with table control wizard
please any one can help me.
regardsHi
Following code is to enable and disable the tbl control using two buttons. Just alter the code and for each button write the sort code.
REPORT YJAN27_SCREEN .
TABLES: SFLIGHT, YFLIGHT_28.
TYPES: BEGIN OF struct1,
carrid like sflight-carrid,
connid like sflight-connid,
fldate like sflight-fldate,
END OF struct1.
CONTROLS TBL1 TYPE TABLEVIEW USING SCREEN 2700.
DATA: OK_CODE LIKE SY-UCOMM,
CARRID LIKE SFLIGHT-CARRID, "cols in tbl ctrl
CONNID LIKE SFLIGHT-CONNID,
FLDATE LIKE SFLIGHT-FLDATE,
itab TYPE TABLE OF STRUCT1 WITH HEADER LINE,
cols like line of TBL1-COLS,
FLAG TYPE I.
FLAG = 1.
CALL SCREEN 2700.
*& Module STATUS_2700 OUTPUT
* text
MODULE STATUS_2700 OUTPUT.
SET PF-STATUS 'BACK'.
* SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_2700 OUTPUT
*& Module USER_COMMAND_2700 INPUT
* text
MODULE USER_COMMAND_2700 INPUT.
OK_CODE = SY-UCOMM.
CASE OK_CODE.
WHEN 'BACK'.
LEAVE PROGRAM.
WHEN 'DIS'. "write code for sort up
loop AT TBL1-COLS INTO COLS.
COLS-SCREEN-INPUT = 0.
MODIFY TBL1-COLS FROM COLS.
ENDLOOP.
FLAG = 2.
WHEN 'ENA'. "write code for sort down
loop AT TBL1-COLS INTO COLS.
COLS-SCREEN-INPUT = 1.
MODIFY TBL1-COLS FROM COLS.
ENDLOOP.
FLAG = 1.
ENDCASE.
ENDMODULE. " USER_COMMAND_2700 INPUT
*& Module GET_DATA OUTPUT
* text
MODULE GET_DATA OUTPUT.
select carrid connid fldate from SFLIGHT into table itab.
ENDMODULE. " GET_DATA OUTPUT
*& Module POPULATE_TBL OUTPUT
* text
MODULE POPULATE_TBL OUTPUT.
MOVE-CORRESPONDING ITAB TO SFLIGHT.
ENDMODULE. " POPULATE_TBL OUTPUT
*& Module CHANGE_SCREEN OUTPUT
* text
MODULE CHANGE_SCREEN OUTPUT. " use this module if you want to hide the other button
CASE FLAG.
WHEN 1.
LOOP AT SCREEN.
IF SCREEN-NAME = 'B_ENA'.
SCREEN-INVISIBLE = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
LOOP AT SCREEN.
IF SCREEN-NAME = 'B_DIS'.
SCREEN-INVISIBLE = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
WHEN 2.
LOOP AT SCREEN.
IF SCREEN-NAME = 'B_DIS'.
SCREEN-INVISIBLE = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
LOOP AT SCREEN.
IF SCREEN-NAME = 'B_ENA'.
SCREEN-INVISIBLE = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDCASE.
ENDMODULE. " CHANGE_SCREEN OUTPUT
PROCESS BEFORE OUTPUT.
MODULE STATUS_2700.
MODULE CHANGE_SCREEN. " use this if you want to display one button at a time
MODULE GET_DATA.
loop at itab WITH control TBL1.
MODULE POPULATE_TBL. " populate tbl ctrl
endloop.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_2700. " do the sort operations
loop at itab.
endloop.
Hope this helps
Regards,
Jayanthi.K -
Module Pool Progrmaing Table Control
Hi Experts,
I Have Created a Module pool Program, In that I have add a table Control.
i have write all logic and i have to update to the database also. Now my Requirement is when i am enter the data in the table control in first field after that i press enter it will go to the next field this is my requirement..
example : in my table control i have 3 fields
matnr maktx meins
i have enter the value of matnr after i press tab button it will go to the next field like that i need in replacing of tab button i press enter it will go to the next field.
Thanks
SankarHi ,
Initialy you have to set the cursor inside the table control required filed using SET cursor statement inside the PBO , each user interaction in PAI you have to capture the line of table control where cursor is currently set using GET CURSOR and again in PBO SET the cursor for your required filed .
Regards,
Ratheesh BS -
Select-option in module pool with table Control
HI,
How to use the select-option in Module Pool and how Can i use the Table control in it.
Can any body give me some Clues.
with rgds
RanjithHi ..
PBO.
LOOP at <table contriol>
module --- Inside the module
DATA: g_uti TYPE REF TO cl_fobu_input_util.
if rollname <> space.
CREATE OBJECT g_uti
EXPORTING typename =rollname.
*....convert to external pattern
CALL METHOD g_util->output_convert
EXPORTING
field_value_int = p_value " This is Tablecontrol-low
IMPORTING
field_value_ext = p_value. " Retrun value for Low
ENDLOOP.
lly you have code in PAI
DATA: g_util_1 TYPE REF TO cl_fobu_input_util.
if rollname <> space.
CREATE OBJECT g_util_1
EXPORTING typename = rollname.
*....convert to internal pattern
CALL METHOD g_util_1->input_convert
EXPORTING
field_value_ext = p_value
IMPORTING
field_value_int_c = p_value.
The above code should be written for tablecontrol-high aswell..
you can also refer: Inlcude LSE16NF10 line no 341 & 434 (SE16n)
Nag -
Problem in module pool with table control scrolling
hi,
i am using the table control in module pool,in the table control i have radion button for all the rows.
After i got the data into the table control ,if i select radio button and if i press vertical scroll bar button, that radio button is deselecting,how to solve this issue.
Please help me.Hi
Generally we don't keep radiobuttons in table control for selecting the records
We keep check boxes for selecting the records
Radio button is used to select a single from a group of records and at a time only one is selected, where as checkboxes at a time you can select a single or multiple.
So use checkboxes and code correctly see the doc for Table control
syntax:
CONTROLS .
if you only want to determine the row of the table control. SY´-SUBRC allows you to check if the cursor is placed in a row of a table control.
u need to comment the performs of table control fields and write ur own perform statements. And u have to declare the table control fields as separate internal tables.
Go through this urls.
www.****************
www.sap-img.com
Check the below links.
http://www.planetsap.com/howdo_a.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dbac5135c111d1829f0000e829fbfe/content.htm
http://sap.niraj.tripod.com/id25.html
Reward points if useful
Regards
Anji -
Module pool question -table control related
Hi All,
I have table control with field mark some input enabled fields in it Now the problem is when i change the content of one row and select that row then control goes to modue in PAI which is called on ON REQUEST but the changed vaule is not capturing in it only slected row with previous content come in that module . Can u suggest some solution or neccessary setting to be done in attribute of tabe control?
If possible provide code for it
Thanks
ParagHi,
Please go through the following code below to solve your issue.
REPORT demo_dynpro_tabcont_loop_at.
CONTROLS flights TYPE TABLEVIEW USING SCREEN 100.
DATA: cols LIKE LINE OF flights-cols,
lines TYPE i.
DATA: ok_code TYPE sy-ucomm,
save_ok TYPE sy-ucomm.
DATA: itab TYPE TABLE OF demo_conn.
TABLES demo_conn.
*SELECT * FROM spfli INTO CORRESPONDING FIELDS OF TABLE itab.*
LOOP AT flights-cols INTO cols WHERE index GT 2.
cols-screen-input = '0'.
MODIFY flights-cols FROM cols INDEX sy-tabix.
ENDLOOP.
CALL SCREEN 100.
MODULE status_0100 OUTPUT.
SET PF-STATUS 'SCREEN_100'.
DESCRIBE TABLE itab LINES lines.
flights-lines = lines.
ENDMODULE.
MODULE cancel INPUT.
LEAVE PROGRAM.
ENDMODULE.
MODULE read_table_control INPUT.
MODIFY itab FROM demo_conn INDEX flights-current_line.
ENDMODULE.
MODULE user_command_0100 INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'TOGGLE'.
LOOP AT flights-cols INTO cols WHERE index GT 2.
IF cols-screen-input = '0'.
cols-screen-input = '1'.
ELSEIF cols-screen-input = '1'.
cols-screen-input = '0'.
ENDIF.
MODIFY flights-cols FROM cols INDEX sy-tabix.
ENDLOOP.
WHEN 'SORT_UP'.
READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
IF sy-subrc = 0.
SORT itab STABLE BY (cols-screen-name+10) ASCENDING.
cols-selected = ' '.
MODIFY flights-cols FROM cols INDEX sy-tabix.
ENDIF.
WHEN 'SORT_DOWN'.
READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
IF sy-subrc = 0.
SORT itab STABLE BY (cols-screen-name+10) DESCENDING.
cols-selected = ' '.
MODIFY flights-cols FROM cols INDEX sy-tabix.
ENDIF.
WHEN 'DELETE'.
READ TABLE flights-cols INTO cols WITH KEY screen-input = '1'.
IF sy-subrc = 0.
LOOP AT itab INTO demo_conn WHERE mark = 'X'.
DELETE itab.
ENDLOOP.
ENDIF.
ENDCASE.
ENDMODULE. -
Module pool in table control wizared
Hi
I have created in module pool table control wizared created insert and delete rows in output.
insert the data in table control the colume is not save.
can u tell me the save the data in table control.
pls tell me the flow of save button.
after insert the record how to save the data in table control wizard in module pool.
can u tell me the save button functionality.
after save data will add in table.Hi Venkat,
I think you have already posted this query with the subject line "Table control" with the thread below today.
table control
Try with the online link we have provided you will learn that way on your own.
Nobody here will write the whole logic for you.
Try to put in your efforts.
Regards
Abhii
Edited by: Abhii on Sep 8, 2010 3:13 PM -
Module Pool with Table Control.
Hi,
I have developed two screens .
in the first screen the user enters the data and press the Next Push button then
in the second screen it should display data in the table control.
For that purpose I have written code.
when the user press Next Button then I wrote like this.
case ok_code.
when 'NEXT'.
CALL SCREEN '9001'.
ENDCASE.
AND In the PBO Event of the Screen 9001 I have written a Function Module to Popup the data
in the table control.
But the problem is when the user press the Next Button it is displaying table control without
data. But when the press the Back button and again he press the Next Button then it is displaying.
So, Where is the Problem ?
How can I correct it ?
Bye,
Satya.Hi
IN PAI
case ok_code.
when 'NEXT'.
select the data into an internal table using the entered fields in the first screen.
so data is there in ITAB.
CALL SCREEN '9001'.
ENDCASE.
in PBO.
between loop..
MOVE the internal table data to the table control fields
endloop.
see the help for TC
syntax:
CONTROLS .
if you only want to determine the row of the table control. SY´-SUBRC allows you to check if the cursor is placed in a row of a table control.
u need to comment the performs of table control fields and write ur own perform statements. And u have to declare the table control fields as separate internal tables.
Go through this urls.
www.****************
www.sap-img.com
Check the below links.
http://www.planetsap.com/howdo_a.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dbac5135c111d1829f0000e829fbfe/content.htm
http://sap.niraj.tripod.com/id25.html
Reward points for useful Answers
Regards
Anji -
Module pool in table control how to add the data
Hi
I have created the table contrl.
In table control editable rows, when ever i have enter the data than save it will update the data in data base.
in table control 4 fields like
sales number,sales director,sales manager,sales hirarchy.
in three fields or editable
first field or non editable only for numaric values disply.
that way i have entered three fields.
first field automatically reganarate heighest value +1.
like that automatically reganarate.
whn ever enter the new vaule
first field autogenarate remaining i will enter the data.after save it will update the data in database.
can u tell me logic for this.Hi Venkat,
I think you have already posted this query with the subject line "Table control" with the thread below today.
table control
Try with the online link we have provided you will learn that way on your own.
Nobody here will write the whole logic for you.
Try to put in your efforts.
Regards
Abhii
Edited by: Abhii on Sep 8, 2010 3:13 PM -
Hi
I have created table control.in that editable row can add the new value also created.after adding new value
in will auto incremented based on sales numer in heighest number + 1 like that u can add.
after increment update the table in data base.
can u tell me the after enter the data in table control tall me the 'save' button functionality and it will auto incremented
based on one field
for example sales order number.
great for me
please tell meHi Venkat,
I think you have already posted this query with the subject line "Table control" with the thread below today.
table control
Try with the online link we have provided you will learn that way on your own.
Nobody here will write the whole logic for you.
Try to put in your efforts.
Regards
Abhii
Edited by: Abhii on Sep 8, 2010 3:13 PM -
Module pool program - populating values for columns in Table control
Hi all,
In my module pool program Table control i am having 10 columns fields.
in one of the column field i have used 'PROCESS ON VALUE-REQUEST' to get the material no.
in that F4 search help list is having releated information of the material like material group, company code, description etc.
user while searching for material they will use F4 search help and in that list they will select the material .
From the list I need releated information of the materials like material group, company code, description etc
to be populated in other columns while selecting the material .( User is not ready to enter all the values for the fileds)
I appended the releated values for the material in the Table control Internal table in the Process on value-request Module.
(after selecting material by the user from F4 search help)
even then I am not getting the data in the screen.
kindly help me how to proceed to get the data in other columns.
Thanks in advance,
sharmaHi Himanshu Verma ,
Thanks for fast reply.
but i tried with field names available in F4 Internal table.
even then I am not getting.
T_DYNPFLD_MAPPING-FLDNAME = ' MTART.
APPEND T_DYNPFLD_MAPPING TO ITAB_DYNPFLD_MAPPING.
T_DYNPFLD_MAPPING-FLDNAME = 'MBRSH'.
APPEND T_DYNPFLD_MAPPING TO ITAB_DYNPFLD_MAPPING.
SELECT
MATNR
MTART
MBRSH
MATKL
BISMT
MEINS
BSTME
FROM MARA
INTO TABLE INT_F4
up to 5000 rows
CLEAR INT_F4.
****function module to get pop-up window of f4.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'MATNR'
DYNPPROG = W_PROGNAME
DYNPNR = W_SCR_NUM
DYNPROFIELD = 'V_TAB-MATNR'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = INT_F4
RETURN_TAB = RETURN_VALUES
DYNPFLD_MAPPING = ITAB_DYNPFLD_MAPPING
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.
IF SY-SUBRC NE 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE .
V_TAB-matnr = RETURN_VALUES-FIELDVAL.
endif.
I have used the above code. I am not getting the field values available in ITAB_DYNPFLD_MAPPING.
kindly help me how to get the exact row for the F4 table.
Thanks in advance.
sharma -
Table Control in Module Pool Programming
In my Module Pool program I have created a Table Control on my screen. In my Table one column is the Checkbox. When I make changes in any of the Checkbox and scroll the Table or scroll with mouse,the data is lost.I am updating the database table and for that I have created a 'SAVE' button.But to make the changes I have to Scroll the Table on the screen and the changed data is lost.
Please guide me or if possible then tell me the Flow Logic of Module Pool with Table Control??
Thanks for the Help....PROCESS BEFORE OUTPUT.
MODULE INITIALIZE.
*&spwizard: pbo flow logic for tablecontrol 'TBLALLOC_CYC'
module TBLALLOC_CYC_change_tc_attr.
*&spwizard: module TBLALLOC_CYC_change_col_attr.
loop at GT_NEW_ALLOC
into GT_NEW_ALLOC_WA
with control TBLALLOC_CYC
cursor TBLALLOC_CYC-current_line.
module TBLALLOC_CYC_get_lines.
*&spwizard: module TBLALLOC_CYC_change_field_attr
endloop.
MODULE STATUS_9003.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_9003.
*MODULE USER_COMMAND_9003.
*&spwizard: pai flow logic for tablecontrol 'TBLALLOC_CYC'
loop at GT_NEW_ALLOC.
chain.
field GT_NEW_ALLOC_WA-/BIC/ZALLOCCYC.
field GT_NEW_ALLOC_WA-/BIC/UFACT_FLG.
field GT_NEW_ALLOC_WA-CHANGEDBY.
field GT_NEW_ALLOC_WA-CH_ON.
field GT_NEW_ALLOC_WA-/BIC/ECHAT.
module TBLALLOC_CYC_modify on chain-request.
endchain.
endloop.
module TBLALLOC_CYC_user_command.
*&spwizard: module TBLALLOC_CYC_change_tc_attr.
*&spwizard: module TBLALLOC_CYC_change_col_attr.
module TBLALLOC_CYC_user_command.
MODULE USER_COMMAND_9003.
MODULE INITIALIZE OUTPUT.
At the time of initialization of the screen data is to be displayed
by calling Function Module ZUFACTS_FETCH_ALLOC_CYC.
CALL FUNCTION 'ZUFACTS_FETCH_ALLOC_CYC'
TABLES
T_ALLOC = GT_NEW_ALLOC
Pass the value displayed in Internal Table GT_OLD_ALLOC.
GT_OLD_ALLOC[] = GT_NEW_ALLOC[].
MOVE GT_OLD_ALLOC TO GT_OLD_ALLOC.
*****Initialize the ok_code.
CLEAR OK_CODE .
ENDMODULE. " INITIALIZE OUTPUT
MODULE USER_COMMAND_9003 INPUT.
CASE : OK_CODE.
WHEN 'SAVE'.
CALL FUNCTION 'ZUFACTS_UPDATE_ALLOC_CYC'
TABLES
T_OLD_ALLOC = GT_OLD_ALLOC
T_NEW_ALLOC = GT_NEW_ALLOC
EXCEPTIONS
NO_FIELD_UPDATED = 1
UNSUCCESSFUL_UPDATION = 2
OTHERS = 3
IF SY-SUBRC = 1.
MESSAGE I005 .
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF SY-SUBRC = 2.
MESSAGE E006.
ENDIF.
WHEN 'CANCEL' OR 'BACK' OR '%EX' OR 'RW'.
LEAVE TO SCREEN 0.
ENDCASE.
CLEAR OK_CODE.
ENDMODULE. " USER_COMMAND_9003 INPUT -
How to generate a mail on click of save button on Module pool program.
Hi geeks,
I am developing a Module pool having table control..The table control is supposedly having 10 columns. The user enters values in first 5 colmns and when he saves , a mail should be generated to his hierarchy indicatiing it .How could this be achieved?? . The mail should just have details like the i/p entered in screen . If possible explain through a code snippet..
Thanks in advance
Regards,
Navinwhen you press save button, get the sy-ucomm and write the below code. Capture the entries from
table control and send the mail.
DATA : it_objpack TYPE STANDARD TABLE OF sopcklsti1 ,
it_objtxt TYPE STANDARD TABLE OF solisti1 ,
it_objbin TYPE STANDARD TABLE OF solisti1 ,
it_reclist TYPE STANDARD TABLE OF somlreci1 ,
wa_doc_chng TYPE sodocchgi1,
wa_objhead TYPE soli_tab,
l_attachment TYPE i,
l_testo TYPE i.
DATA: wa_objpack TYPE sopcklsti1,
wa_objtxt TYPE solisti1 ,
wa_objbin TYPE solisti1 ,
wa_reclist TYPE somlreci1 .
CLEAR: wa_reclist,
wa_objhead,
wa_objtxt, it_objtxt[],
wa_objbin, it_objbin[],
wa_objpack, it_objpack[].
CLEAR wa_objbin.
REFRESH it_objbin.
it_objbin[] = gt_mess_att[].
DESCRIBE TABLE it_objbin LINES l_attachment.
LOOP AT it_message INTO wa_message.
wa_objtxt = wa_message. APPEND wa_objtxt TO it_objtxt.
ENDLOOP.
DESCRIBE TABLE it_objtxt LINES l_testo.
wa_doc_chng-obj_name = 'Test'.
wa_doc_chng-expiry_dat = sy-datum + 10.
CONCATENATE 'Send '
INTO wa_doc_chng-obj_descr .
wa_doc_chng-sensitivty = 'P'.
wa_doc_chng-obj_prio = '1'.
wa_doc_chng-doc_size = l_testo * 255.
CLEAR wa_objpack-transf_bin.
wa_objpack-head_start = 1.
wa_objpack-head_num = 0.
wa_objpack-body_start = 1.
wa_objpack-body_num = l_testo.
wa_objpack-doc_type = 'RAW'.
APPEND wa_objpack TO it_objpack.
CLEAR wa_reclist.
wa_reclist-copy = 'X'.
IF wa_email IS NOT INITIAL.
wa_reclist-receiver = wa_email-value1.
wa_reclist-express = 'X'.
wa_reclist-rec_type = 'U'.
wa_reclist-notif_del = 'X'.
wa_reclist-notif_ndel = 'X'.
APPEND wa_reclist TO it_reclist.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = wa_doc_chng
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = it_objpack
object_header = wa_objhead
contents_bin = it_objbin
contents_txt = it_objtxt
receivers = it_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.
WRITE 'mail fail'.
ENDIF.
ENDIF.
Maybe you are looking for
-
How do I get 5.1 audio out of itunes
I have just bought a Mini DisplayPort to HDMI adaptor for my iMac. I run an HDMI lead from the adaptor to a Sony AV receiver, and the AV receiver is connected to a Samsung TV by HDMI. The problem I have is with both TV and Receiver switched on the o
-
How can I send an SMS message to a group?
I cannot seem to figure out how to add a second recipient to the SMS message. I routinely beep out messages to the 5 people I work with, I'd hate to send it out to each separately.
-
I have a problem, my wife has an ipad with photos , emails etc etc, she has recently got herself a new iPad Air, has now been using that for two or more months, more photos (new) more emails and other stuff. What she wants to do is get all she wants
-
Reading in a certain number of characters from a file.
Hi guys, I need some pointers on how to read in a specified number of characters from a text file.For example,how would I read in the first 100 characters to an array from a text file with an unspecfied number of characters (more than 100 rather than
-
Hi, I am using SFTP where I am converting a flat-file to XML using module. I am getting the following error in channel: Could not deliver message to XI: com.sap.aii.af.service.cpa.CPAException: Couldn't retrieve inbound binding for the given P/S/A va