Deleted function module--urgent
Hi all,
By mistake i deleted a z* function module. From version management when i cannot get the function module back. when i press the retrieve button i got an error message saying " deleted function module cannot be recovered".
So please help me in recovering the function module.
Thanks in advance
Regards
Sree
Hi Srinivas,
I am checking old programs that are going to be copied to new upgrade version... one of them calls a FM that no longer exist, I guess that it was deleted...
I am looking for a way to find a deleted FM (if it was deleted), I just have the FM name, but I don't have the function group.
I guess that without it, it isn't possible to retrieve any old version, if there is one, is it?
Maybe looking in a table? looking for any change request (by the way, my user do not have authorization for SE03).
Regards.
José Gabriel.
Similar Messages
-
IIs it possible to retrive deleted Function Module
Hi all,
i just want to know is it possible to retrive deleted Function Module .
the request is not released yet.Hi Sai,
Its not possible. (Confirm by contacting ur Basis people, if they can help).
But the following is valid only if your function module is(or was) a transportable object.
Go to SE37, enter your function module name and create. Assign it to the same function group and have the same interface and description. Save it, activate it.
Now go back to SE37, enter the function module name, in the menu, 'Utilities>Versions>Version Management'. Now you should see all your previous versions. Select the most recent past version. Do a retrieve and then activate it as the latest version.
Not sure if it works. But still give it a try.
Best Regards,
Anjali
Message was edited by: Anjali Devi -
Recover the deleted Function modules
Hi,
I have a function group and some functional modules in it. Accdently i have deleted that function group and all the functional modules are also get deleted. Is there any way to recover those function group or the function modules.
Thanks,
Abhishek SarkarHi,
Function Module can be restored if it is versionsed previously in version management.
Kindly use the below steps,
(1.) Create FM on same name (In which FM is deleted previously).
(2.) Utility->Version->Version Management
(3.) Previous versions are found in "Versions in the version database".
(4.) Check for previous version and retrieve it.
Thanks
Prembabu R -
Master Data Deletion / Function Module RSDMD_DEL_MASTER_DATA
I need to develop an automated way of deleting some data from 0employee master data InfoObject. The data we need to delete from the InfoObject is held in a separate ODS.
I believe the only automated way is to create an ABAP program which uses the function module RSDMD_DEL_MASTER_DATA.
Can anyone please advise what FM RSDMD_DEL_MASTER_DATA is designed to do.
I'm also not an ABAP'er so I'm unsure how to code what I need. Can anyone help me with this?
Many thanks,
Mark.Hi,
if you need to delete master data selectively, then use the mentionned function module: RSDMD_DEL_MASTER_DATA
check this thread:
Re: delete master data
from which you'll get the code:
TYPES: ly_CHAVL type RSCHAVL.
DATA: gt_CHAVL_DEL type table of ly_CHAVL.
DATA: lv_chavl LIKE RSGENERAL-CHAVL.
SELECT DISTINCT <IOBJ_ID>
INTO TABLE gt_chavl_del
FROM /BIC/Z<ODSNAME>
WHERE .....
"the above will fill your inttable.
CALL FUNCTION 'RSDMD_DEL_MASTER_DATA'
EXPORTING
I_IOBJNM = 'IOBJ'
* I_FLG_DELETE_ALL = ' '
I_FLG_DELETE_SIDS = 'X'
* I_FLG_DELETE_SIDS_ASK = ' '
I_FLG_DELETE_TEXTS = 'X'
I_T_CHAVL = gt_CHAVL_DEL
I_FLG_DIALOG = ' '.
* I_FLG_FORCE_DELETE = ' '
* I_FLG_SIMULATION = ' '
* I_WITHOUT_PROTOCOL = ' '
* IMPORTING
* E_RESULT =
* E_T_SIDVAL_USED =
* E_T_PROTOCOL =
* E_T_ULIST_DIM =
* E_T_ULIST_ATR_NAV =
* E_T_ULIST_HIE =
* E_T_ULIST_HIE_NODE =
* E_T_ULIST_QUERY =
* E_PROT_OBJECT =
* E_PROT_SUBOBJECT =
* E_PROT_EXTNUM =
* EXCEPTIONS
* ILLEGAL_INPUT = 1
* IOBJ_ERROR = 2
* SID_ERROR = 3
* PROGRAM_ERROR = 4
* ENQUEUED = 5
* QUEUE_ERROR = 6
* NO_CHKTAB = 7
* CHKTAB_NOT_GENERATED = 8
* NO_AUTHORITY = 9
* RSDPW_ERROR = 10
* OTHERS = 11
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
let me know should you need further assistance...
hope this helps...
Olivier.
Message was edited by:
Olivier Cora -
Hi,
I need to create a Function Module where this FM should send a document as attachment to the internet mail id , example [email protected]
Please help me out.
Thanks,
Pavan.Hi,
Will a prog. be fine for sending a mail to xternal mail id??
Mail with attachments: SO_NEW_DOCUMENT_ATT_SEND_API1
Mail without attachments: SO_NEW_DOCUMENT_SEND_API1
For Understanding the Function Module
SO_OBJECT_Send:
http://www.thespot4sap.com/articles/SAP_Mail_Understanding_SO_Object_Send.asp
Try this:
REPORT zsendemail .
PARAMETERS: psubject(40) type c default 'Testing',
p_email(40) type c default '[email protected]'.
data: it_packing_list like sopcklsti1 occurs 0 with header line,
it_contents like solisti1 occurs 0 with header line,
it_receivers like somlreci1 occurs 0 with header line,
it_attachment like solisti1 occurs 0 with header line,
gd_cnt type i,
gd_sent_all(1) type c,
gd_doc_data like sodocchgi1,
gd_error type sy-subrc.
data: it_message type standard table of SOLISTI1 initial size 0
with header line.
*START-OF-SELECTION.
START-OF-SELECTION.
Perform populate_message_table.
*Send email message, although is not sent from SAP until mail send
*program has been executed(rsconn01)
PERFORM send_email_message.
*Instructs mail send program for SAPCONNECT to send email(rsconn01)
perform initiate_mail_execute_program.
*& Form POPULATE_MESSAGE_TABLE
* Adds text to email text table
form populate_message_table.
Append 'Line1' to it_message.
Append 'Line2' to it_message.
Append 'Line3' to it_message.
Append 'Test- 1' to it_message.
endform. " POPULATE_MESSAGE_TABLE
*& Form SEND_EMAIL_MESSAGE
* Send email message
form send_email_message.
* Fill the document data.
gd_doc_data-doc_size = 1.
* Populate the subject/generic message attributes
gd_doc_data-obj_langu = sy-langu.
gd_doc_data-obj_name = 'SAPRPT'.
gd_doc_data-obj_descr = psubject.
gd_doc_data-sensitivty = 'F'.
* Describe the body of the message
* Information about structure of data tables
clear it_packing_list.
refresh it_packing_list.
it_packing_list-transf_bin = space.
it_packing_list-head_start = 1.
it_packing_list-head_num = 0.
it_packing_list-body_start = 1.
describe table it_message lines it_packing_list-body_num.
it_packing_list-doc_type = 'RAW'.
append it_packing_list.
* Add the recipients email address
clear it_receivers.
refresh it_receivers.
it_receivers-receiver = p_email.
it_receivers-rec_type = 'U'.
append it_receivers.
* Call the FM to post the message to SAPMAIL
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
exporting
document_data = gd_doc_data
put_in_outbox = 'X'
importing
sent_to_all = gd_sent_all
tables
packing_list = it_packing_list
contents_txt = it_message
receivers = it_receivers
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.
* Store function module return code
gd_error = sy-subrc.
* Get it_receivers return code
loop at it_receivers.
endloop.
endform. " SEND_EMAIL_MESSAGE
*& Form INITIATE_MAIL_EXECUTE_PROGRAM
* Instructs mail send program for SAPCONNECT to send email.
form initiate_mail_execute_program.
wait up to 2 seconds.
if gd_error eq 0.
submit rsconn01 with mode = 'INT'
with output = 'X'
and return.
endif.
endform. " INITIATE_MAIL_EXECUTE_PROGRAM
Regards,
Anjali -
Problem in Logical Databse Call via Function Module - Urgent
Hi Experts,
To use the Logical Database(LDB) in the function module(Custom) I am using the function module - LDB_PROCESS. But I didn't get any output. I am attaching the code. Please Help me in this.
DATA : W_LDBNAME LIKE TRDIR-LDBNAME.
DATA : IT_CALLBACK LIKE TABLE OF LDBCB WITH HEADER LINE,
IT_SELECTIONS LIKE TABLE OF RSPARAMS WITH HEADER LINE,
IT_PERNR TYPE TABLE OF PERNR WITH HEADER LINE.
MOVE 'PNP' TO W_LDBNAME.
IT_CALLBACK-LDBNODE = 'PERNR'.
IT_CALLBACK-GET = 'X'.
IT_CALLBACK-CB_PROG = SY-CPROG.
IT_CALLBACK-CB_FORM = 'CALLBACK_PERNR'.
APPEND IT_CALLBACK.
CLEAR IT_CALLBACK.
IT_SELECTIONS-KIND = 'S'.
IT_SELECTIONS-SELNAME = 'PNPPERNR'.
IT_SELECTIONS-SIGN = 'I'.
IT_SELECTIONS-OPTION = 'EQ'.
IT_SELECTIONS-LOW = '100178'.
APPEND IT_SELECTIONS.
CLEAR IT_SELECTIONS.
CALL FUNCTION 'LDB_PROCESS'
EXPORTING
LDBNAME = W_LDBNAME
VARIANT =
EXPRESSIONS =
FIELD_SELECTION =
DYN_NODE_TYPES =
TABLES
CALLBACK = IT_CALLBACK
SELECTIONS = IT_SELECTIONS
EXCEPTIONS
LDB_NOT_REENTRANT = 1
LDB_INCORRECT = 2
LDB_ALREADY_RUNNING = 3
LDB_ERROR = 4
LDB_SELECTIONS_ERROR = 5
LDB_SELECTIONS_NOT_ACCEPTED = 6
VARIANT_NOT_EXISTENT = 7
VARIANT_OBSOLETE = 8
VARIANT_ERROR = 9
FREE_SELECTIONS_ERROR = 10
CALLBACK_NO_EVENT = 11
CALLBACK_NODE_DUPLICATE = 12
CALLBACK_NO_PROGRAM = 13
CALLBACK_NO_CBFORM = 14
DYN_NODE_NO_TYPE = 15
DYN_NODE_INVALID_TYPE = 16
OTHERS = 17.
IF SY-SUBRC <> 0.
MESSAGE I039(ZABA) WITH SY-SUBRC.
ENDIF.
LOOP AT IT_PERNR.
message i039(zaba) with 'Inside loop'.
WRITE : / IT_PERNR-PERNR, IT_PERNR-BUKRS.
ENDLOOP.
*& Form CALLBACK_PERNR
text
-->L_LDBNAME text
-->L_IT_PAYROLL text
-->TYPE text
-->PAY99_REULT text
-->L_EVT text
-->L_CHK text
FORM CALLBACK_PERNR USING L_LDBNAME LIKE TRDIR-LDBNAME
L_IT_PERNR LIKE PERNR
L_EVT type C
L_CHK type C.
message i039(zaba) with 'Inside Callback'.
WRITE : / L_IT_PERNR-PERNR,
L_IT_PERNR-BUKRS.
MOVE-CORRESPONDING L_IT_PERNR TO IT_PERNR.
APPEND IT_PERNR.
CLEAR IT_PERNR.
ENDFORM. "CALLBACK_PERNR
Thanks in advance
Arul Jothi.Hi,
I think Arul commented the 'it_selections' while trying out.. I couldn't get the fm work for PNP.. it worked fine with the FI LDBs.. just didn't seem to like the PNP..
Regards,
Suresh Datti -
Need code for a function module- Urgent
Hi friends,
I have a requirement where I am giving material description as an import parameter in the function module. ( Material description could be a wild search -- say - Mat* ) I want a sub routine in the function module which should get all the materials from the database ( mara or makt..not sure ) for the user entered Material description.
I want this particular code to be written using a sub-routine using formal parameters inside this fm . Could any one send me the code for this.
Thanks in advance,
Vishnu.Hi Vishvanath,,
Please find the below code.
DATA : BEGIN OF itab OCCURS 0,
matnr LIKE makt-MATNR,
MAKTX LIKE makt-MAKTX,
END OF itab.
DATA : BEGIN OF itab1 OCCURS 0,
matnr LIKE makt-MATNR,
MAKTX LIKE makt-MAKTX,
END OF itab1.
data : a(5) type c value 'TEST'.
perform mat_no using a.
form mat_no using p_a.
data : lv_temp(4) type c.
select matnr maktx from makt into table itab.
loop at itab.
lv_temp = itab-maktx+0(4).
if lv_temp = p_a.
move itab to itab1.
APPEND ITAB1.
endif.
endloop.
loop at itab1.
write :/ itab1.
endloop.
endform. " mat_no
Thanks.
Amjad. -
USE of Function module-- urgent
hi,
can any one explain the use of "OPEN_FI_PERFORM_00002050_P "
thnxhi,
go to se37,
and give fm name,
display,
and then u can see function module documentation.
reward points if helpful. -
Hi Friends,
I have a statement as below in one function module :
SELECT a~matnr
INTO TABLE t_mast
FROM mast AS a
INNER JOIN stko AS k
ON astlnr EQ kstlnr
AND astlal EQ kstlal
WHERE a~werks eq plant
AND a~stlal eq alt
AND k~datuv EQ date .
Import parameters are : Plant , Alt and Date.
Here the problem is while I am executing the f/m it is giving the correct values only if input all the input parameters Plant,Alt and Date.If I give Plant and Alt as blank then it is not giving any values from the table.
Could you please telme the resolution for this.
Regards,
Vishnu.
If I am notYou can overcome from this problem by using the RANGES.
Like:
ranges: r_alt for mast-stlal,
r_date for stko-datuv,
r_plant for mast-werks.
if not alt is initial.
r_alt-sign = 'I'.
r_alt-option = 'EQ'.
r_alt-low = alt.
append r_alt.
endif.
if not date is initial.
r_date-sign = 'I'.
r_date-option = 'EQ'.
r_date-low = date.
append r_date.
endif.
if not plant is initial.
r_plant-sign = 'I'.
r_plant-option = 'EQ'.
r_plant-low = plant.
append r_plant.
endif.
SELECT a~matnr
INTO TABLE t_mast
FROM mast AS a
INNER JOIN stko AS k
ON a~stlnr EQ k~stlnr
AND a~stlal EQ k~stlal
WHERE a~werks in r_plant
AND a~stlal in r_alt
AND k~datuv in r_date.
Regards,
Naimesh Patel -
ABOUT FUNCTION MODULE (urgent)
hi ,
is any one know about below function module.
CUST_ACCT_STMT_REQUEST_LITE
we schedule customer account statement in th background.
we want to add some functionality.
if any one know anything then it will be appreciated.
thans,
jackHi,
I am giving the Function Modules list link, from there you can findout which is suitable for your application:
http://sap-img.com/abap/function-list.htm
Regards,
Bhaskar -
Re:Function modules: urgent
Hi,
Iam copying the standard function module, i have copied the function group also but the includes, subroutines are not getting copied, already my team created function group , the same function group name i gave, any one can help me in this issue
Thanks in advanceHi
Go to se84 Tcode in the left side pane select Program Library and in that select Function Groups, then in the right side pane give ur Function group name and execute, then click the check box of ur function group name and in the menu select Function Groups - Copy and then give the new Function Group name which should with either Z or Y, then it will ask u whether to copy the Function modules or not, click on ok. The Function Modules belong to that Function Group gets copied into ur new Function Group.
Regards
Haritha. -
Is there any BAPI or function module to delete entries from a table (VBAK)
Hi Everybody,
this is my first thread in SDN...
my problem follows...
A report is be created that selects all sales orders created by e-Sales that are more than 20 minutes old and still have a delivery block:
tables:
VBAK sales document: header data
selection fields:
VBAK-LIFSK ≠ <BLANK>
VBAK-ERNAM = userID used by e-Sales / IVE
(EP-BATCH / EAI-BATCH)
VBAK-ERDAT <= Current system Date
VBAK-ERZET <= Current system Time - 20 minutes
These orders should be deleted from SAP system.
This report should be scheduled to run regularly every 10 minutes.
my doubt : is ther any BAPI or Function module to delete entries from a standard table...if no what is the way to delete the enteries from a std table...
best replies will be rewarded....
regards
ReddyHi Vasanth ,
thanks for your reply.
i tried in the same manner what u mentioned.
but how to pass only one parameter to the functionmodule..
here in this case we have to pass only update flag as 'D'..
i did the same it giving dump..
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_SY_DYN_CALL_ILLEGAL_TYPE', was
not caught and
therefore caused a runtime error.
The reason for the exception is:
The call to the function module "BAPI_SALESORDER_CHANGE" is incorrect:
In the function module interface, you can specify only
fields of a specific type and length under "ORDER_HEADER_INX".
Although the currently specified field
"INT_ORDER_HEADER_INX" is the correct type, its length is incorrect.
my pgm :
*& Report YNEW_ORDER_DELETION
REPORT ynew_order_deletion.
TABLES:vbak.
PARAMETERS:
p_lifsk LIKE vbak-lifsk DEFAULT '02'.
SELECT-OPTIONS:
s_lifsk FOR vbak-lifsk DEFAULT '10',
s_ernam FOR vbak-ernam,
s_erdat FOR vbak-erdat,"DEFAULT sy-datum.
s_erzet FOR sy-uzeit.
*PARAMETERS:
p_erzet LIKE sy-uzeit.
s_erdat like vbak-erdat,
s_erzet like vbak-erzet.
DATA:
BEGIN OF int_final OCCURS 0,
w_vbeln TYPE vbak-vbeln,
END OF int_final.
DATA:
int_return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
DATA: int_order_header_inx LIKE bapisditmx OCCURS 0 WITH HEADER LINE.
DATA:
wf_time TYPE sy-uzeit.
INITIALIZATION.
s_ernam-low = 'KULKARMA'.
s_ernam-sign = 'I'.
s_ernam-option = 'EQ'.
APPEND s_ernam.
s_ernam-low = 'EAI-BATCH'.
s_ernam-sign = 'I'.
s_ernam-option = 'EQ'.
APPEND s_ernam.
wf_time = sy-uzeit - 1200.
p_erzet = sy-uzeit - 1200.
p_erzet-low = wf_time.
APPEND s_erzet.
int_order_header_inx-updateflag = 'D'.
APPEND int_order_header_inx.
START-OF-SELECTION.
SELECT vbeln FROM vbak
INTO TABLE int_final
WHERE lifsk EQ p_lifsk
AND ernam IN s_ernam
AND erdat IN s_erdat
AND erzet IN s_erzet.
IF sy-subrc = 0.
LOOP AT int_final.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = int_final-w_vbeln
ORDER_HEADER_IN =
order_header_inx = int_order_header_inx
SIMULATION =
BEHAVE_WHEN_ERROR = ' '
INT_NUMBER_ASSIGNMENT = ' '
LOGIC_SWITCH =
NO_STATUS_BUF_INIT = ' '
TABLES
return = int_return
ORDER_ITEM_IN =
ORDER_ITEM_INX =
PARTNERS =
PARTNERCHANGES =
PARTNERADDRESSES =
ORDER_CFGS_REF =
ORDER_CFGS_INST =
ORDER_CFGS_PART_OF =
ORDER_CFGS_VALUE =
ORDER_CFGS_BLOB =
ORDER_CFGS_VK =
ORDER_CFGS_REFINST =
SCHEDULE_LINES =
SCHEDULE_LINESX =
ORDER_TEXT =
ORDER_KEYS =
CONDITIONS_IN =
CONDITIONS_INX =
EXTENSIONIN =
ENDLOOP.
LOOP AT int_return.
WRITE:/ int_return-type,
int_return-id,
int_return-number,
int_return-message.
ENDLOOP.
ENDIF.
please help me ..its a very urgent issue to be solved...
am waiting for ur reply...
regards
gangareddy -
Function modules or BAPI for deleting plan costs on a cost center
Hi all,
I search for a function module or bapi to delete plan costs / activity on a cost center.
At the moment I update the planning with 0, but that cause a mass of needles entries on the cost centers.
For check and posting I use the function group 6026 - BAPI_COSTACTPLN_* ,
but there is no function for deleting.
Has anyone an idea?
Thx for help - points as reward !check
BAPI_COSTACTPLN_POSTACTINPUT Activity Input Planning: Posting
BAPI_COSTACTPLN_POSTACTOUTPUT Activity/Price Planning: Posting
BAPI_COSTACTPLN_POSTKEYFIGURE Stat. Key Figure Planning: Postings
BAPI_COSTACTPLN_POSTPRIMCOST Primary Cost Planning: Postings
BAPI_PDTRANSCO_POSTPRIMCOST Transfer of Planning Data: Post Primary Costs
K40C CO Actual Postings, Manual
BAPI_ACC_PRIMARY_COSTS_POST Accounting: Post Primary Costs
BAPI_COPAACTUALS_POSTCOSTDATA BAPI Operating Concern: Post Costing-Based Actua
BAPI_PRIM_COST_CHECK_AND_POST Primary Costs: Formal Parameter Check
S@meer -
Urgent: Problems in Generic Extraction by Function Module
Hi BW Gurus,
I am new to SDN and also new to generic extraction using function module. My requirement is to extract long text(142 char) from CRM to BW as the text is not stored in database table I used function module read_text with in another ZXXX function module copy of (RSAX_BIW_GET_DATA_SIMPLE). In my extract structure I used GUID(char,32), Langu, long text(142 char) and 2 placeholders. Text can be extracted by passing STXH table fields(Tdname, Tdid, Tdobject, Tdspars) to read_text as parameters and i also need to use CRMD_ORDERADM_H field GUID(32 char) to compare 1st 32 chars of tdname(70 char) with Guid to select Guids and loop thru this Guids and for each Guid i need to append lines of text to e_t_data but as i donot know ABAP i unable to write the code for this. Through my friends help i wrote code when i check in RSA3 it is displaying the text but when i replicate into BW and load into data target in monitor the status is red with records initially but afterwards it will be red status again with 0 from 0 records for initial load again.when i check on job logs the errors i have are:
The background job has created a job log file of 2Gb size and it is currently on a infinite loop writing entries into the SAP System Log that it cannot write to the Job log file due to Error 22 for write/read access to a file this is because of the datasource i have created. Please find my Function module and if anyone would please correct FM and send me that will be really great.I appreciate it in advance.
MY Function Module is:
FUNCTION Z_CRMORDERH_STR_TXT.
""Local Interface:
*" IMPORTING
*" VALUE(I_REQUNR) TYPE SRSC_S_IF_SIMPLE-REQUNR
*" VALUE(I_DSOURCE) TYPE SRSC_S_IF_SIMPLE-DSOURCE OPTIONAL
*" VALUE(I_MAXSIZE) TYPE SRSC_S_IF_SIMPLE-MAXSIZE OPTIONAL
*" VALUE(I_INITFLAG) TYPE SRSC_S_IF_SIMPLE-INITFLAG OPTIONAL
*" VALUE(I_READ_ONLY) TYPE SRSC_S_IF_SIMPLE-READONLY OPTIONAL
*" VALUE(I_REMOTE_CALL) TYPE SBIWA_FLAG DEFAULT SBIWA_C_FLAG_OFF
*" TABLES
*" I_T_SELECT TYPE SRSC_S_IF_SIMPLE-T_SELECT OPTIONAL
*" I_T_FIELDS TYPE SRSC_S_IF_SIMPLE-T_FIELDS OPTIONAL
*" E_T_DATA STRUCTURE YCRM_TEXT_STR OPTIONAL
*" EXCEPTIONS
*" NO_MORE_DATA
*" ERROR_PASSED_TO_MESS_HANDLER
***" EXCEPTIONS NO_MORE_DATA
*" ERROR_PASSED_TO_MESS_HANDLER
Tables: CRMD_ORDERADM_H, STXH.
Auxiliary Selection criteria structure
data: l_s_select type srsc_s_select.
Maximum number of lines for DB table
Statics: s_s_if type srsc_s_if_simple,
counter
s_counter_datapakid like sy-tabix,
Cursor
s_cursor type cursor.
data: i_crmtext type standard table of TLINE .
types: begin of xsreph ,
GUID type CRMD_ORDERADM_H-guid,
end of xsreph.
data: i_guid type standard table of xsreph.
data: I_TEXT type STXH-TDNAME.
data: xempl like YCRM_TEXT_STR occurs 0 with header line.
data: t_tab like dd03l-tabname.
Select ranges
ranges: l_r_guid for CRMD_ORDERADM_H-guid.
l_r_connid for sflight-connid.
Initialization mode (first call by SAPI) or data transfer mode
(following calls) ?
if i_initflag = sbiwa_c_flag_on.
Initialization: check input parameters
buffer input parameters
prepare data selection
Check DataSource validity
case i_dsource.
when 'yCRM_TEXT'. " for S_SREPH1
when others.
if 1 = 2. message e009(r3). endif.
this is a typical log call. Please write every error message like this
log_write 'E' "message type
'R3' "message class
'009' "message number
i_dsource "message variable 1
' '. "message variable 2
raise error_passed_to_mess_handler.
endcase.
append lines of i_t_select to s_s_if-t_select.
Fill parameter buffer for data extraction calls
s_s_if-requnr = i_requnr.
s_s_if-dsource = i_dsource.
s_s_if-maxsize = i_maxsize.
Fill field list table for an optimized select statement
(in case that there is no 1:1 relation between InfoSource fields
and database table fields this may be far from beeing trivial)
append lines of i_t_fields to s_s_if-t_fields.
we will do our selection based on what is in the p table for the
infoobject
else. "Initialization mode or data extraction ?
Data transfer: First Call OPEN CURSOR + FETCH
Following Calls FETCH only
First data package -> OPEN CURSOR
if s_counter_datapakid = 0.
Fill range tables BW will only pass down simple selection criteria
of the type SIGN = 'I' and OPTION = 'EQ' or OPTION = 'BT'.
LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'GUID'.
MOVE-CORRESPONDING L_S_SELECT TO L_R_GUID.
APPEND L_R_GUID.
ENDLOOP.
case i_dsource.
when 'YCRM_TEXT'. " for S_SREPH1
t_tab = 'CRMD_ORDERADM_H'.
endcase.
select GUID
from (t_tab)
into table i_guid where PROCESS_TYPE = 'ZACI' and ( OBJECT_ID < '0000000042').
select tdname from stxh into i_text where tdobject = 'TEXT'.
if sy-subrc ne 0.
message e009(r3).
this is a typical log call. Please write every error message like this
log_write 'E' "message type
'R3' "message class
'009' "message number
i_dsource "message variable 1
'No master data found'. "message variable 2
raise error_passed_to_mess_handler.
endif.
Determine number of database records to be read per FETCH statement
from input parameter I_MAXSIZE. If there is a one to one relation
between DataSource table lines and database entries, this is trivial.
In other cases, it may be impossible and some estimated value has to
be determined.
open cursor with hold s_cursor for
select (s_s_if-t_fields) from CRMD_ORDERADM_H
where GUID in L_R_GUID .
ENDIF.
Fetch records into interface table.
named E_T_'Name of extract structure'.
fetch next cursor s_cursor
appending corresponding fields
of table e_t_data
package size s_s_if-maxsize.
IF SY-SUBRC <> 0.
CLOSE CURSOR S_CURSOR.
RAISE NO_MORE_DATA.
ENDIF.
as we are doing this only once can use the select statement.
***data: crmtext like tline occurs 0 with header line.
**data: i_crmtext type standard table of TLINE.
**data: i_guid type standard table of xsreph.
data: l_guid type THEAD-TDNAME.
data: st_guid type xsreph.
data: st_crmtext type TLINE.
data: lan type THEAD-TDSPRAS.
lan = 'E'.
loop at i_guid into st_guid.
l_guid = st_guid-guid.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = 'A002'
LANGUAGE = lan
NAME = l_guid
OBJECT = 'CRM_ORDERH'
ARCHIVE_HANDLE = 0
LOCAL_CAT = ' '
IMPORTING
HEADER =
TABLES
LINES = i_crmtext.
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8
e_t_data-guid = l_guid.
loop at i_crmtext into st_crmtext.
move lan to e_t_data-langu.
move st_crmtext-tdline to e_t_data-description.
append e_t_data.
endif.
endloop.
clear: st_guid,l_guid.
refresh: i_crmtext.
endloop.
S_COUNTER_DATAPAKID = S_COUNTER_DATAPAKID + 1.
endif.
ENDFUNCTION.
please Gurus as I donot know ABAP i appreciate if anyone would write a FM based on requirement and send me that will be really great this is my request. I gurantee of award points for good answers.
Regards
KishoreHi,
The statement <b>RAISE NO_MORE_DATA</b> should be active (uncommented) in your code. Otherwise, the infinte loop occurs.
See also, the Siggi's blog:
/people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module
BTW, was it your thread here:
Re: Urgent: problems in extracting Long Text
Best regards,
Eugene -
Which function module to delete job log?
Hi, I submit report via jobname and jobcount. After I close job and run it, we can see jobname is still in job log by SMX. But client doesn't want to see it, so who can kindly tell me which function module can delete jobname from job log?
Thanks a lot.
Jacktry CALL FUNCTION 'BP_JOB_DELETE'
If you have used JOB_OPEN before the SUBMIT to create the job, you can automatically delete the job upon successful completion by setting the parameter DELANFREP = 'X' in the JOB_OPEN function call.. this way the user will only see the logas for cancelled/aborted jobs..
~Suresh
Message was edited by: Suresh Datti
Maybe you are looking for
-
I could always just choose a photo to use as a desktop and it would work fine. Now they all seem to display at full resolution meaning that I only get a small segment of the picture. I have tried cropping to the display dimensions but it is still too
-
How to use dynamic action to fill multi item on a page ?
Hi.. I want to fill multi items on a page so I build a dynamic action ( Execute PL/SQL Code ) to do it .The problem is that when the page loads I can't see any data and I tried to see the session values using debug and I found data. Moreover when I s
-
I have instructors wanting to publish as a .pdf file instead of publishing the large folder full of files. I have 2 questions. How do I explain the difference between this interactive ".pdf" (more like a .swf) file as opposed to the Save As > .pdf fo
-
Why does it say to contact customer support when I go to make a app purchase.
Why does it say to contact customer support when I go to make a app purchase.
-
About Oracle-xe and Oracle-xe-client
Hi all, I prefer tell you I'm french and I may do mistakes... ^^ I use Oracle database on my computer because I've a course about Oracle and PL/SQL. So I'm the single user of this database. I would like to know if I must install oracle-xe and oracle-