Calling a Z-Report using a Function Module.
Hi All,
Kindly provide me help in:
How to call a Z-Report which generates a flat file in the Application server. And which I want to call using a Function Module and display all the fields which are generated in the file.
Steps I've already done:
1) I've created a Function Module
2) Created a structure which I've used in the Tables tab of the FM
3) Used:
SUBMIT ZSCOMAR
VIA SELECTION-SCREEN
USING SELECTION-SET 'Variant'
AND RETURN.
Output whichI'm receiving:
Only the no. of rows is shown but not the fields individually.
Thanks in Advance.
Regards,
Sreedhar.
you can either :
display the data from the ZPROGRAM(by editing it)
or
by reading the file again in you FM using open dataset, read dataset, close dataset. and display the content
Similar Messages
-
Hi,
Actually i want to send a mail ( to a yahoo mail address ) using a report, as i came to know that one has to use the above Function Module i started using it. But i am unable to send an e-mail. the report is getting executed and the return code i am getting is zero and i am getting an object i.d. too. But the recipient is not receiving the mail.
I am attaching my code here. Please help.
Any help in this regard is highly appreciated.
DATA : tab_lines TYPE i.
DATA : var_receiver LIKE sadrud.
EXPORT TO FM
DATA : wa_docu_data LIKE sodocchgi1.
IMPORT FROM FM
DATA : flag_sent_to_all LIKE sonv-flag.
DATA : obj_id LIKE sofolenti1-object_id.
TABLES TO FM
DATA : obj_header LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE.
DATA : rec_list LIKE somlreci1 OCCURS 0 WITH HEADER LINE.
DATA : obj_txt LIKE solisti1 OCCURS 0 WITH HEADER LINE.
START-OF-SELECTION.
var_receiver-address = '[email protected]'.
obj_txt-line = 'This is the sent Document'.
APPEND obj_txt.
CLEAR obj_txt.
DESCRIBE TABLE obj_txt LINES tab_lines.
READ TABLE obj_txt INDEX tab_lines.
BREAK-POINT.
wa_docu_data-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( obj_txt ).
wa_docu_data-obj_name = 'TESTING'.
wa_docu_data-obj_descr = 'This is Test Mail'.
wa_docu_data-proc_type = 'R'.
wa_docu_data-proc_name = 'Z34_MAIL_TEST'.
wa_docu_data-proc_syst = '*'.
wa_docu_data-proc_clint = '*'.
wa_docu_data-to_do_out = 'X'.
wa_docu_data-sensitivity = 'O'.
obj_header-transf_bin = ' '.
obj_header-head_start = 1.
obj_header-head_num = 0.
obj_header-body_start = 1.
obj_header-body_num = tab_lines.
obj_header-doc_type = 'RAW'.
APPEND obj_header.
CLEAR obj_header.
BREAK-POINT.
rec_list-receiver = var_receiver-address.
rec_list-rec_type = 'U'.
rec_list-express = 'X'.
rec_list-com_type = 'INT'.
rec_list-notif_del = 'X'.
APPEND rec_list.
CLEAR rec_list.
BREAK-POINT.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = wa_docu_data
put_in_outbox = 'X'
commit_work = 'X'
IMPORTING
sent_to_all = flag_sent_to_all
new_object_id = obj_id
TABLES
packing_list = obj_header
OBJECT_HEADER =
CONTENTS_BIN =
contents_txt = obj_txt
CONTENTS_HEX =
OBJECT_PARA =
OBJECT_PARB =
receivers = rec_list
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 SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
BREAK-POINT.
WRITE : / , 'Object Created' , obj_id,50 'SENT TO ALL' , flag_sent_to_all.
LOOP AT rec_list.
WRITE :/ , 'status' , rec_list-retrn_code,
/ , 'Sent to' , rec_list-receiver.
ENDLOOP.
Thanks and Regards,
Goutham.Hi,
Thanks for the early Reply.
After executing the program i am getting the output
object created : a number
send to all = 'X'.
status is 0.
After this i am going to transaction : SCOT, where i have given my name in MAIL, and executing the document. after execution the document is placed under error heading.
Now i went to Transaction : SOST, here i see my document with the Message Status :
DEFINITELY cannot transfer message to node EMAIL due to connection error.
What Exactly does this message mean.
Any help in this regard is highly appreciated. -
Problem with calling a report from a function module. Please help! URGENT!
Hi Experts,
I have a scenarion like this:
XI -
> Function Module -
> ABAP Report
From XI I am callingf a function module in another R/3 system. This function module inturn calls a ABAP report using SUBMIT statement. The function module and the report reside in the same R/3 system.
I am calling the report like this:
SUBMIT yseg_save_bp_data WITH SELECTION-TABLE rspar
AND RETURN.
The problem is when I run the function module directly in the R/3 system then it calls the report without any problem.
On the other hand, when I call the function module from XI then the report is not called. On debug mode I found that the program exits just at the Submit statement. Why is this strange problem?
What mistake am I doing? Is there any limitations or restrictions with SUBMIT statement.
What is the correct way of using submit statement in this scenario?
Kindly help me!
Thanks
GopalHi Rao,
I have created the FM as remote RFC. Infact XI is able to call the FM. Only problem is when it reaches the point where the report is called via SUBMIT it exits.
Help me please!
Thanks
Gopal -
How to call the Report program into Function module
Hi Experts,
Actually I want to create the DataSource. But I have only the ALV report program. I need to create function module but I dont know how to call the ALV report program using in function module
So could you please any one send the Document or step by step method?
Advance Thanks,
SathisIf the report is just based out of a table than create a Generic Extractor using View.
If its an InfoSet query than create a Generic Extractor on that InfoSet.
If its an ABAP report than create a Generic Extractor using FM
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a0f46157-e1c4-2910-27aa-e3f4a9c8df33 -
Update sap table using a function module call by php code
Hello,
I m trying to update the table VBAP using a function module ZZ_SET_DISTANCE call by a php code.
But I have this problem:
the saprfc seems to work well but when I look to the table VBAP the fields have not been update.
I tried the function module in debug mode and it work good. The fields are update.
I also handle the saprfc call function and the return SAPRFC_OK
This are the function module ZZ_SET_DISTANCE, and the php code
//PHP CODE
$fce = saprfc_function_discover($sap,"ZZ_SET_DISTANCE");
if (! $fce ) {echo "Echec d'ouverture du module fonction "; exit;}
saprfc_import ($fce,"COMMANDE", '0000001998');
saprfc_table_init($fce,"TBLE_CMDE");
$val=array();
$val['NUM_POST']='000030';
$val['HN_EXP']='';
$val['ST_EXP']='';
$val['PC_EXP']='';
$val['CI_EXP']='';
$val['CO_EXP']='';
$val['HN_REC']='';
$val['ST_REC']='';
$val['PC_REC']='';
$val['CI_REC']='';
$val['CO_REC']='';
$val['DIST']='popo';
saprfc_table_append ($fce,"TBLE_CMDE", $val);
$rfc_rc = saprfc_call_and_receive ($fce);
echo "\n".$rfc_rc;
if ($rfc_rc != SAPRFC_OK) { if ($sap == SAPRFC_EXCEPTION ) echo ("Exception raised: ".saprfc_exception($fce)); else echo (saprfc_error($fce)); }else{echo '/execution de la function ;}
saprfc_function_free($fce);
//FUNCTION MODULE ZZ_SET_DISTANCE
FUNCTION ZZ_SET_DISTANCE.
""Local Interface:
*" IMPORTING
*" VALUE(COMMANDE) TYPE VBELN
*" TABLES
*" TBLE_CMDE STRUCTURE ZADD_COM_LOXAN
DATA : NUMC TYPE VBELN.
NUMC = COMMANDE .
WHILE STRLEN( NUMC ) < 10 .
CONCATENATE '0' NUMC INTO NUMC .
ENDWHILE .
DATA tble_addrcomm LIKE LINE OF TBLE_CMDE .
LOOP AT TBLE_CMDE INTO tble_addrcomm.
DATA : NUMP TYPE POSNR.
NUMP = tble_addrcomm-NUM_POST.
WHILE STRLEN( NUMP ) < 6 .
CONCATENATE '0' NUMP INTO NUMP .
ENDWHILE .
UPDATE VBAP SET ARKTX = tble_addrcomm-DIST
WHERE VBELN EQ COMMANDE
AND POSNR EQ NUMP.
ENDLOOP.
ENDFUNCTION.
Is anybody can help me?
thank.Marie, create a Blog please, about more details for dummies....
1) how to connect to sap system?
2) you run the php code where? in a webserver or where?
3) wich is the url for run the FM: ZZ_SET_DISTANCE
4) you placed some dlls files on the web server?
please is interesting this...
Thanks -
How can i use reuse_alv_fieldcatalog_merge function module
I am using below steps for populating the final internal table.How can I use reuse_alv_fieldcatalog_merge function module in the place of declaring all these fields.How canI put title of the report in reuse_alv_fieldcatalog_merge function module.
FORM BUILD_FIELDCATALOG .
FIELDCAT-TABNAME = 'IT_FINAL'.
FIELDCAT-FIELDNAME = 'KUNNR'.
FIELDCAT-SELTEXT_M = 'Customer Name'.
FIELDCAT-JUST = 'L'.
FIELDCAT-KEY = 'X'.
FIELDCAT-DATATYPE = 'C'.
APPEND FIELDCAT TO I_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_FINAL'.
FIELDCAT-FIELDNAME = 'VBELN'.
FIELDCAT-SELTEXT_M = 'Invoice Reference'.
FIELDCAT-JUST = 'L'.
FIELDCAT-KEY = 'X'.
APPEND FIELDCAT TO I_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_FINAL'.
FIELDCAT-FIELDNAME = 'VKBUR'.
FIELDCAT-SELTEXT_M = 'Sales Office'.
FIELDCAT-JUST = 'L'.
FIELDCAT-KEY = 'X'.
FIELDCAT-DATATYPE = 'C'.
APPEND FIELDCAT TO I_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_FINAL'.
FIELDCAT-FIELDNAME = 'VKGRP'.
FIELDCAT-SELTEXT_M = 'Sales Person'.
FIELDCAT-JUST = 'L'.
FIELDCAT-KEY = 'X'.
FIELDCAT-DATATYPE = 'C'.
APPEND FIELDCAT TO I_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_FINAL'.
FIELDCAT-FIELDNAME = 'POSNR'.
FIELDCAT-SELTEXT_M = 'Item No'.
FIELDCAT-JUST = 'L'.
FIELDCAT-KEY = 'X'.
APPEND FIELDCAT TO I_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_FIANL'.
FIELDCAT-FIELDNAME = 'ARKTX'.
FIELDCAT-SELTEXT_M = 'Item Description'.
FIELDCAT-JUST = 'L'.
FIELDCAT-DATATYPE = 'C'.
APPEND FIELDCAT TO I_FIELDCAT.
CLEAR FIELDCAT.Hello,
It is very easy to use reuse_alv_fieldcatalog_merge.
You try this it will work.
example
data:
DATA : gv_repid TYPE syrepid VALUE sy-repid . " Report id
PERFORM set_field_catalog USING gst_struct CHANGING lst_fieldcat.
FORM set_field_catalog USING uv_tab TYPE slis_tabname
CHANGING xt_fieldcatalog TYPE slis_t_fieldcat_alv.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = gv_repid
i_internal_tabname = uv_tab
i_inclname = gv_repid
CHANGING
ct_fieldcat = xt_fieldcatalog
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " set_field_catalog_spec -
How to use SO_OBJECT_SEND function module
Hi friends,
how to use SO_OBJECT_SEND function module in 4.0B Server .hi
good
check this code
REPORT ZTSAPMAIL.
DATA: X_OBJECT_TYPE LIKE SOOD-OBJTP.
DATA: BEGIN OF X_OBJECT_HD_CHANGE.
INCLUDE STRUCTURE SOOD1.
DATA: END OF X_OBJECT_HD_CHANGE.
DATA: BEGIN OF X_OBJCONT OCCURS 10.
INCLUDE STRUCTURE SOLI.
DATA: END OF X_OBJCONT.
DATA: BEGIN OF X_OBJHEAD OCCURS 0.
INCLUDE STRUCTURE SOLI.
DATA: END OF X_OBJHEAD.
DATA: BEGIN OF RAW_HEAD.
INCLUDE STRUCTURE SORH.
DATA: END OF RAW_HEAD.
DATA: BEGIN OF X_RECEIVERS OCCURS 0.
INCLUDE STRUCTURE SOOS1.
DATA: END OF X_RECEIVERS.
PARAMETERS: RECEIVER LIKE X_RECEIVERS-RECNAM. " Name
*BUILD MESSAGE HEADER
MOVE 'Sort field goes here' TO X_OBJECT_HD_CHANGE-OBJSRT. " Sort field
MOVE 'Name of the object goes here' TO X_OBJECT_HD_CHANGE-OBJNAM. " Name
MOVE 'Document title goes here' TO X_OBJECT_HD_CHANGE-OBJDES. " Title
MOVE 'F' TO X_OBJECT_HD_CHANGE-OBJSNS. " Functional OBJECT
MOVE 'E' TO X_OBJECT_HD_CHANGE-OBJLA. " Language
Object type of the new document
MOVE 'RAW' TO X_OBJECT_TYPE.
CLEAR X_OBJCONT.
MOVE 'Contents of mail' TO X_OBJCONT-LINE.
APPEND X_OBJCONT.
CLEAR X_OBJCONT-LINE. APPEND X_OBJCONT.
MOVE 'More contents' TO X_OBJCONT-LINE.
APPEND X_OBJCONT.
MOVE 'Still more contents'
to x_objcont-line.
APPEND X_OBJCONT.
MOVE ' ' TO X_OBJCONT-LINE.
APPEND X_OBJCONT.
Specific header (Dependent on the object type, here RAW)
REFRESH X_OBJHEAD.
DESCRIBE TABLE X_OBJCONT LINES RAW_HEAD-RAWSIZ.
MOVE RAW_HEAD TO X_OBJHEAD.
APPEND X_OBJHEAD.
*RECEIVERS table
CLEAR X_RECEIVERS.
REFRESH X_RECEIVERS.
MOVE RECEIVER TO X_RECEIVERS-RECNAM. " Name
MOVE 'B' TO X_RECEIVERS-RECESC. " Receiver type
MOVE 'X' TO X_RECEIVERS-SNDCP. " Send as a copy
MOVE 'X' TO X_RECEIVERS-SNDEX. " EXPRESS DOCUMENT
APPEND X_RECEIVERS.
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
folder_id = 'OUTBOX'
forwarder = x_forwarder
object_fl_change = x_object_fl_change
OBJECT_HD_CHANGE = X_OBJECT_HD_CHANGE
object_id = x_object_id
OBJECT_TYPE = X_OBJECT_TYPE
OUTBOX_FLAG = 'X'
OWNER = SY-UNAME
store_flag = x_store_flag
importing
object_id_new = x_object_id_new
sent_to_all = x_sent_to_all "May need to use
TABLES
OBJCONT = X_OBJCONT
OBJHEAD = X_OBJHEAD
objpara = x_objpara
objparb = x_objparb
RECEIVERS = X_RECEIVERS.
reward point if hlepful.
thanks
mrutyun^ -
U00BFCan I use a function module as a driver program for sapscript?
Hi,
I have to use a function module as driver program for sapscript and there is no any value in the form (the data are not transferred)...
but if I call the sapcript from a report with the same code as in my function module all the data are transferred OK.
please, can you tell me if there is any problem in use of a function module in this case? is it impossible at all or is there any tip to apply?
thank you all in advance.Hi,
first of all it is possible to use a function module to process a SapScript form.
The mistake on your side is probably the definition of the variables that you want to pass to the form. Please make sure they are defined as global (via SE37 --> Goto --> Global Data) then it should be working.
In addition you could take a look at e.g. function module "PRINT_DUNNING_NOTICE". This is SAP standard and they are using it to print a SapScript form.
Best regards
Arno Speitkamp -
How to use a function module in a subroutine
Hi,
I am working on a report where i have to create list boxes for 5 fields.Instead of using the function module VRM_SET_VALUES for each field can i use subroutine?
If so, can anyone tell me the procedure for that?Its very urgent.
Thanks and Regards,
HemaHi,
I have written the code like this.
FORM VALUE USING V_NAME.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING id = v_name
values = v_list.
ENDFORM.
AT SELECTION-SCREEN OUTPUT.
REFRESH V_LIST.
v_name = 'P_COMMER'.
v_value-key = 'C'.
v_value-text = 'Commercial'.
APPEND v_value TO v_list.
v_value-key = 'N'.
v_value-text = 'Non-Commercial'.
APPEND v_value TO v_list.
v_value-key = ' ' .
v_value-text = 'Both'.
APPEND v_value to v_list.
PERFORM VALUE USING V_NAME.
REFRESH V_LIST1.
v_name1 = 'P_DIRECT'.
v_value1-key = 'D'.
v_value1-text = 'Direct'.
APPEND v_value1 to v_list1.
v_value1-key = 'I'.
v_value1-text = 'Indirect'.
APPEND v_value1 to v_list1.
PERFORM VALUE USING V_NAME1.
REFRESH V_LIST2.
v_name2 = 'P_DIR'.
v_value2-key = 'D'.
v_value2-text = 'D'.
APPEND v_value2 TO v_list2.
v_value2-key = 'C'.
v_value2-text = 'C'.
APPEND v_value2 TO v_list2.
v_value2-key = ' ' .
v_value2-text = ' '.
APPEND v_value2 to v_list2.
PERFORM VALUE USING V_NAME2.
REFRESH V_LIST3.
v_name3 = 'P_LOW'.
v_value3-key = 'Y'.
v_value3-text = 'Yes'.
APPEND v_value3 TO v_list3.
v_value3-key = 'N'.
v_value3-text = 'No'.
APPEND v_value3 TO v_list3.
v_value3-key = ' ' .
v_value3-text = ''.
APPEND v_value3 to v_list3.
PERFORM VALUE USING V_NAME3.
REFRESH V_LIST4.
v_name4 = 'P_PARENT'.
v_value4-key = 'P'.
v_value4-text = 'Parent'.
APPEND v_value4 TO v_list4.
v_value4-key = 'C'.
v_value4-text = 'Child'.
APPEND v_value4 TO v_list4.
v_value4-key = ' ' .
v_value4-text = ''.
APPEND v_value4 to v_list4.
PERFORM VALUE USING V_NAME4.
REFRESH V_LIST5.
v_name5 = 'P_PREF'.
v_value5-key = 'P'.
v_value5-text = 'Preferred'.
APPEND v_value5 TO v_list5.
v_value5-key = 'N'.
v_value5-text = 'NotPreferred'.
APPEND v_value5 TO v_list5.
v_value5-key = ' ' .
v_value5-text = ''.
APPEND v_value5 to v_list5.
PERFORM VALUE USING V_NAME5.
Now I am getting the same set of values in all the fields.How can I solve this?
Thanks and Regards,
Hema -
How to use the function module ....
hi
how to use the function module ssf_function_module_name in smartformsHi..
If you are using this Function module, you can get the generated function module name of smartform dynamically. It is good progrmaming practice to get the fucntion module name dynamically because there might be some problems if you are hard coding in program.
This will return the name of the function module and then from the exporting parameters you can use the fucntion module name to pass parameters to Smartforms.
Check this link.I am expalining here how to use this function module.
https://wiki.sdn.sap.com/wiki/pages/pointstab/viewpageversion.action?pageId=36109&version=2
Calling SMARTFORMS from your ABAP program
REPORT ZSMARTFORM.
Calling SMARTFORMS from your ABAP program.
Collecting all the table data in your program, and pass once to SMARTFORMS
SMARTFORMS
Declare your table type in :-
Global Settings -> Form Interface
Global Definintions -> Global Data
Main Window -> Table -> DATA
Written by : SAP Hints and Tips on Configuration and ABAP/4 Programming
http://sapr3.tripod.com
TABLES: MKPF.
DATA: FM_NAME TYPE RS38L_FNAM.
DATA: BEGIN OF INT_MKPF OCCURS 0.
INCLUDE STRUCTURE MKPF.
DATA: END OF INT_MKPF.
SELECT-OPTIONS S_MBLNR FOR MKPF-MBLNR MEMORY ID 001.
SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.
MOVE-CORRESPONDING MKPF TO INT_MKPF.
APPEND INT_MKPF.
ENDSELECT.
At the end of your program.
Passing data to SMARTFORMS
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = 'ZSMARTFORM'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = FM_NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
if sy-subrc <> 0.
WRITE: / 'ERROR 1'.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
call function FM_NAME
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS =
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS =
USER_SETTINGS = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
TABLES
GS_MKPF = INT_MKPF
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
<b>Reward points if useful</b>
Regards
Ashu -
Archiving using PBS Function modules
Hi All,
I am converting existing report to archiving reports.
For that I am using <b>PBS Commands FUNCTION MODULES</b>. .
ie function module like <b>'/PBS/SELECT_INTO_TABLE'</b>
Can any one send some documents related PBS and how to use these commands or function modules,and sample programs.
thanks in advance..
srinu.Hi ,
Thanks for your help and responce.
I already coded one small program using commands . but its not working properly in perticular case.
Here is the Code.
From EKKO table the fucntion module fetching the data properly.
SELECT SINGLE * FROM EKKO
INTO W_EKKO
WHERE EBELN EQ P_EBELN.
IF SY-SUBRC NE 0.
CALL FUNCTION '/PBS/SELECT_INTO_TABLE'
EXPORTING
ARCHIV 'CMM'
OPTION ''
TABNAME = 'EKKO'
SCHL1_NAME = 'EBELN'
SCHL1_VON = P_EBELN
SCHL1_BIS = P_EBELN
TABLES
I_TABELLE = TAB20
EXCEPTIONS EOF = 4
OTHERS = 2.
LOOP AT TAB20 WHERE ( EBELN EQ P_EBELN ).
MOVE-CORRESPONDING TAB20 TO W_EKKO .
EXIT.
ENDLOOP.
ENDIF.
<b><u>But when I use the function module to fetch from EKPO, its considering only EBELN , but not considering the EBELP .</u></b>
Its fetching all the line items related to this EBELN.
SELECT * UP TO 1 ROWS
INTO CORRESPONDING FIELDS
OF TABLE TAB23
FROM EKPO
WHERE EBELN EQ W_EKKO-EBELN
AND EBELP EQ P_EBELP.
ENDSELECT.
if sy-subrc ne 0.
CALL FUNCTION '/PBS/SELECT_INTO_TABLE'
EXPORTING
ARCHIV = 'CMM'
OPTION = ''
TABNAME = 'EKPO'
SCHL1_NAME = 'EBELN'
SCHL1_VON = W_EKKO-EBELN
SCHL1_BIS = W_EKKO-EBELN
SCHL2_NAME = 'EBELP'
SCHL2_VON = P_EBELP
SCHL2_BIS = P_EBELP
TABLES
I_TABELLE = TAB23
EXCEPTIONS EOF = 4
OTHERS = 2.
LOOP AT TAB23 WHERE ( EBELN EQ W_EKKO-EBELN AND
EBELP EQ P_EBELP ).
MOVE TAB23-ebelp TO W_EKPO-ebelp.
ENDLOOP .
endif.
<u>Please check my code and give me some inputs.
Is there any pre-conditions are needed.</u>
Thanks and Regards,
Srinivas Kalva. -
Unalbe to delete lock entry table using Dequeue function module
Friends,
I display a base ALV list with custom app. tool bar. When i click on a button, i submit another report which updates a z-table for that corresponding row. I create a lock object for this entry before submitting the report. After updating the table, I try to delete the lock object using dequeue function module in the called report, but though the subrc is 0, the lock entry is not getting deleted in SM12. The called report, after dequeue, again submits report 1 (the caller). So, when i try to do some operation for the same row which I first selected, it triggers Foreign_lock exception. When I completely go out of the base list, only then the entry is deleted. Can anyone tell me the reason? I have tried with parameters _SCOPE & _SYNCHRON, but same result.
Regards,
Sathish RHi,
The triggering of the dequeue is not in the proper position as it need to be placed.
Thats the only problem as per u have described the issue.
Place the deque as soon as the report is return the value.
I hope it may work ur issue. -
How to use read_text function module
Hi how to use read_text function module to read purchase order header text .what are all tht things to pass in ID,Name and Object
thanks,
MaheDear,
Use below code.
DATA:IT_LINE LIKE TLINE OCCURS 0 WITH HEADER LINE,
V_TDNAME LIKE THEAD-TDNAME.
V_TDNAME = PO_NUMBER.
CALL FUNCTION 'READ_TEXT'
EXPORTING
* CLIENT = SY-MANDT
ID = 'F01'
LANGUAGE = 'EN'
NAME = V_TDNAME
OBJECT = 'EKKO'
TABLES
LINES = IT_LINE.
Thanks and Regards, -
Calling BI Publisher report using FND_SUBMIT.SUBMIT_REQUEST---
Hi Experts,
We have a requirement in which BI Publisher report will be called using a PL/SQL procedure.
i am successfully able to call BI publisher report using FND_SUBMIT.SUBMIT_REQUEST function.
Business requirement is that the BI publisher report can be generated in PDF,Excel or HTML format.
but i am able to generate the report only in xml format.
Please guide me how to achieve this.
Thanks in Advance,
Cheers
Andy.Make sure you register the Data Definition (with same code as concurrent program short name) and register/upload the Template correctly.
Call fnd_request.add_layout
Then call FND_SUBMIT.SUBMIT_REQUEST
Regards,
Gareth -
Error "Job already started" when calling a adobe form in Z function module
Hi All,
I have a error when calling a adobe form in a custom function module.
I am using FP_FUNCTION_MODULE_NAME to get the adobe form function module and then i am using FP_JOB_OPEN function module to control the printing parameters such as no print preview or no dialog ..etc.. I dont have any exceptions during the call of FP_JOB_OPEN function module ..
Later I am calling my function module which was generated for the adobe form and i am getting the error called " JOB ALREADY STARTED".
I tried executing the same function module in se37 and the PDF form output was generated, and also by commenting FP_JOB_OPEN function module the PDF form output was generated.
But i need the FP_JOB_OPEN function module to control the output based on the output type which triggers the form output such as the medium from nast record which says print or email or fax.. etc
Please let me know how to handling this error.Just as a followup note. If you are testing a function module from SE37 and the test button you will get a value in SY-CPROG. You must override this value for everything to work.
If you override the value of SY-CPROG with the main program that will be calling the function module you have no problem.
John W.
Maybe you are looking for
-
Hi. I think this is a pretty basic LV question, but I have not been able to find a good solution. I am attaching VIs that show the problem I am having, but obviously, the real application is a lot complicated, which forces me to try to do it this way
-
How to set a default value for a page item
I am working with a facility table that has name and address information. The user can add contact name information on a separate page. Since the address for the facility and contact is usually the same, I want to add a default value for the contact
-
I wrote the entire question in the title
-
Hello everyone, I am using Aperture 2, what I am trying to do is, I believe it's called a lasso tool, where you can outline an image and remove it from the picture to place somewhere else. I cannot seem to find that, does anyone know what to do here,
-
Post Author: sjames CA Forum: Desktop Intelligence Reporting Hi All, I have two fields from the same universe. Example - Field 1 called Location code , Field 2 called Location name Location code is populated with the following values 000000000002 00