Debugging of a subroutine pool.
Hi there,
Does anyone knows if is posible to debug a subroutine pool?
I'm trying to print a smartform of a RFQ using the function ME_READ_PO_FOR_PRINTING, but the program prints a different requisition a not the one selected.
I want to capture the RFQ number and pass it as a parameter to the smartform but for any reason I can't get the correct number.
I put a break-point on the program but it doesn't work and I am unable to track and find the problem.
Any help will be appreciated.
Thanks,
Orlando
Hi Orlando,
Are you printing the RFQ from ME52N by assigning an O/P ?
If so then assign O/P to your RFQ and then set further data dispatch time as send as Period job.
Then use program RSNAST00 and you can debug .
If you are doing as a back ground job then :
type JDBG in the OK-code and press enter
Hope this may help you.
Lanka
Message was edited by: Lanka Murthy
Similar Messages
-
SY-SUBRC = 4 after GENERATE SUBROUTINE POOL
Hi,
I am trying to create a dynamic subroutine using the statement:
GENERATE SUBROUTINE POOL t_codeline NAME v_program
MESSAGE v_message
LINE v_line.
IF SY-SUBRC = 0.
PERFORM (v_routine) IN PROGRAM (v_program)
TABLES IM_VKORG
IM_VTWEG
IM_SPART
IM_KUNNR.
Here
v_program TYPE DB2BPNAME,
v_message TYPE BALTMSG,
v_line TYPE SYINDEX,
v_routine(32).
After executing the statement
GENERATE SUBROUTINE POOL t_codeline NAME v_program
MESSAGE v_message
LINE v_line.
I am getting SY-SUBRC = 4 which means Syntax error.
Could you please tell me why the statement GENERATE SUBROUTINE POOL is giving me SY-SUBRC = 4.
Thanking You,
Suryahi,
A few lines to give you an idea
itab11 = 'begin of it_ord_sto_data occurs 0'.
append itab1.
clear itab1.
concatenate 'import it_ord_sto_data from memory id' gc_ord '.' into itab1 separated by space.
append itab1.
clear itab1.
Regards,
Sailaja. -
How to delete Subroutine Pool and delete the custom report in mass
Hello,
How to delete the subroutine pool
Is there any transaction to delete report mass.
Thanks in advance,
Best Regards,
Suresh kumar KYou can use FM RS_DELETE_PROGRAM in your program and pass all the programs
that are to be deleted into that FM using TADIR table..
Alternatively you can create a bdc for the same. -
Hi. how to create Subroutine Pool and call it from sapscript
HI,
Can anyone tell is there any standard subroutine pool available which could fetch the customer number.
how to create an subroutine pool and call it from the sapscript..
please help me
Advance Thanks..
Guhapriyan.Hi Guhapriyan,
1. Create a FORM in your program.
2. call it from sapscript using
/: PERFORM GET_COMPANY_INFO IN PROGRAM YHRR_OFFER_CONTRACT_FORM
/: USING &P0001-BUKRS&
/: CHANGING &COMP_NAME&
/: ENDPERFORM
3. The form in your program should be of the following parameters only.
form GET_COMPANY_INFO tables IN_PAR structure ITCSY
OUT_PAR structure ITCSY.
(important is IN_PAR, OUT_PAR -
where in your read the values passed,
and pass back the values
thru internal table using varname, varvalue)
regards,
amit m. -
Need to create subroutine pool for info structure
Hi gurus,
I need to create a subroutine pool for the info strucuture S891for one of the key figures.(in the extended update rules). and in that i need to write 3 routines for the 3 key figures.
plz help me how to create the subroutine pool for this.
I just went to se38 and choose type subroutine pool and created a prg. But do not know how to proceed further.
Any idea on this?
Regards,
Sakthi.
Edited by: sakthi sri on Sep 6, 2010 9:47 AMHi,
Please Check this link,
http://help.sap.com/saphelp_nw70/helpdata/en/c0/980389e58611d194cc00a0c94260a5/content.htm
How to create variant for csutom screen
New transaction - require variant selection to be disabled
This may help you.
Regards,
Renuka. -
How do we define a sub-routine in a subroutine pool
How do we define a sub-routine in a subroutine pool and how do we call the same in an executable program
Hi
Go to SE38.Create a program and in the program type select Subroutine pool.Inside this u can code for teh various subroutines or forms.
For calling these forms these forms in ur main program refer below link:
<u>http://help.sap.com/saphelp_nw04/helpdata/en/9f/db999535c111d1829f0000e829fbfe/content.htm</u>
Sample code:
Below is the subroutine pool used in the creation of the SAP Script:
Program Name : Z689_SUBROUTINE
Date : 03/28/2007
Author : Sayee Manojnah Kasala
Description : This is the subroutine used for SAP Script,
Z689_SAPSCRIPT.It fetches customer details like
customer name & place
PROGRAM Z689_SUBROUTINE.
Form GET_LAND1
Fetches the country key
*& Form get_land1
text
-->INTABLE text
-->OUTTABLE text
FORM get_land1 TABLES intable STRUCTURE itcsy
outtable STRUCTURE itcsy.
DATA: v_kunnr LIKE kna1-kunnr,
v_land1 LIKE kna1-land1,
v_name1 LIKE kna1-name1.
READ TABLE intable INDEX 1.
v_kunnr = intable-value.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_kunnr
IMPORTING
output = v_kunnr.
IF sy-subrc = 0.
SELECT SINGLE land1
FROM kna1
INTO v_land1
WHERE kunnr = v_kunnr.
IF sy-subrc = 0.
READ TABLE outtable INDEX 1.
outtable-value = v_land1.
MODIFY outtable INDEX 1.
ENDIF.
SELECT SINGLE name1
FROM kna1
INTO v_name1
WHERE kunnr = v_kunnr.
IF sy-subrc = 0.
READ TABLE outtable INDEX 2.
outtable-value = v_name1.
MODIFY outtable INDEX 2.
ENDIF.
ENDIF.
CLEAR: intable,outtable.
ENDFORM. "get_land1
Form GET_LANDX
Fetches the Country Name
*& Form get_landx
text
-->INTABLE text
-->OUTTABLE text
FORM get_landx TABLES intable STRUCTURE itcsy
outtable STRUCTURE itcsy.
DATA: v_land1 LIKE kna1-land1,
v_landx LIKE t005t-landx.
READ TABLE intable INDEX 1.
v_land1 = intable-value.
IF sy-subrc = 0.
SELECT SINGLE landx
FROM t005t
INTO v_landx
WHERE land1 = v_land1 AND spras = 'E'.
IF sy-subrc = 0.
READ TABLE outtable INDEX 1.
outtable-value = v_landx.
MODIFY outtable INDEX 1.
ENDIF.
ENDIF.
CLEAR: intable,outtable.
ENDFORM. "get_landx
It can be called as follows:
PERFORM GET_LANDX IN PROGRAM Z689_SUBROUTINE
USING &V_LAND1&
CHANGING&V_LANDX&
ENDPERFORM.
Reward points if found useful.
Thanks
Vasudha
Message was edited by:
Vasudha L -
how execute the subroutine pool program (progrm name: SAPFM06P).
Hi,
Subroutines are not stored as seperate objects. You cannot execute them.
What you can do is create a report and INCLUDE this subroutine pool and then you can execute this report.
But for that also you need to have PERFORM statements.
Regards,
Sesh -
Hi All
can anybody plz tell me waht is subroutine pool of sapscript??
waiting for replies
THanksHi,
If you want to do calculations on some of the fields in a script one way is to change the print program. And other way is to call a routine in the windw which is in another program.
For eg: if you have a subroutine named ADD_INCOME in a program ZSHAIL_BASIC, you can call the subroutine in SAPScript as follows:
/: PERFORM ADD_INCOME IN PROGRAM ZSHAIL_BASIC
/: USING &var1&
/: CHANGING &var2&
/: ENDPERFORM.
Here the input parameter to the subroutine is var1 and the value returned by the subroutine is var2.
In the program ZSHAIL_BASIC, you have to call the subroutine as
FORM ADD_INCOME TABLES IN_TAB STRUCTURE ITCSY OUT_TAB STRUCTURE ITCSY.
ENDFORM.
IN_TAB is a structure of type ITCSY,which has 2 components, NAME and value.
So in the program, var1(which is sent from SAPScript) , will be stored as IN_TAB-NAME and its value will be in IN_TAB-VALUE. You can utilise the IN_TAB-VALUE and after performing the required operations, the return value should be assigned to table OUT_TAB.
This value can thus be obtained in var2 specified in SAPScript.
Thanks and Regards,
Bharat Kumar Reddy.V -
Hello,
I am using statement GENERATE SUBROUTINE POOL to create a subroutine pool to dynamically filla table. I get a dump if more than 36 are created...
Dump text: "No more than 36 temporary subroutine pools can be generated.
This maximum value has been exceeded. "
SAP documentation states .....
"a maximum of 36 temporary subroutine pools may be created.
A temporary subroutine pool generated for an internal mode cannot be explicitly deleted. It remains available from its generation up to the point where the internal mode is cancelled. "
Does anyone have an idea how I can delete the subroutine pool in internal mode?
Thanks for your help,
RuairiYou might want to have a look at this thread.
Re: GENERATE SUBROUTINE POOL - Need to create More than 36 times
Regards,
Rich Heilman -
hi
can anyone tell me how should i transport subroutine pool pleaseHi,
Subroutines are not stored as seperate objects. You cannot execute them.
What you can do is create a report and INCLUDE this subroutine pool and then you can execute this report.
But for that also you need to have PERFORM statements.
Regards,
Sesh -
How 2 debug a Perform subroutine in sap script
Hi,
I have a perform endperform in Script. But tht is not working in some case. i m trying to debug but i m not able to go inside the routine and see wht it is doing? . can any one help me how to debug a subroutine in sap script.Hi Panigrahi,
1) Put a break point in your perform.
2) YOu should change the dispatch option in your Output screen of the transaction which triggers your sap script. The dispatch option should be 1 (Send with a periodically scheduled job).
Then save your transaction.
3) Go to se38 and run the program RSNAST00.
Give the Object Key as the Document Number for which you are triggering the script output.
The control will stop in your perform.
Regards,
Ravi -
Macros Vs Subroutine pool code change
Hi All,
I need to chage the code as per my company coding standards.
As per the requiremnt i am using the PERFORM statment more time to dispaly Field Catalog based on some coditions.
PERFORM Statments:
PERFORM F_FIRST_FIELD_CATALOG USING C_HKONT
C_BSIS
W_COL_POS
TEXT-010
SPACE.
FORM Statments:
FORM F_FIRST_FIELD_CATALOG USING US_FIELDNAME TYPE ANY
US_REF_TAB TYPE ANY
US_COL_POS TYPE ANY
US_COLTEXT TYPE ANY
US_DO_SUM TYPE ANY.
CLEAR E_CATLOG.
MOVE : US_FIELDNAME TO E_CATLOG-FIELDNAME,
US_REF_TAB TO E_CATLOG-TABNAME,
US_COL_POS TO E_CATLOG-COL_POS,
US_COLTEXT TO E_CATLOG-SELTEXT_L,
US_DO_SUM TO E_CATLOG-DO_SUM.
APPEND E_CATLOG TO I_CATLOG1.
CLEAR E_CATLOG.
ENDFORM. " f_first_field_catalog
I need to change this code using MACROS.
Can any one help how to to this code using MACROS..
and also send me documnt for Macros.
Best Regards,
Sridhar AmruthAs per my opinion macro are outdated. and also debugging not possible in macros
Still you want to use
then
define F_FIRST_FIELD_CATALOG.
CLEAR E_CATLOG.
MOVE : &1 TO E_CATLOG-FIELDNAME,
&2 TO E_CATLOG-TABNAME,
&3 TO E_CATLOG-COL_POS,
&4 TO E_CATLOG-SELTEXT_L,
&5 TO E_CATLOG-DO_SUM.
APPEND E_CATLOG TO I_CATLOG1.
ENDFORM.
F_FIRST_FIELD_CATALOG: C_HKONT C_BSIS W_COL_POS TEXT-010 SPACE.
a® -
Hi All,
I need to chage the code as per my company coding standards.
As per the requiremnt i am using the PERFORM statment more time to dispaly Field Catalog based on some coditions.
Statments:
PERFORM F_FIRST_FIELD_CATALOG USING C_HKONT
C_BSIS
W_COL_POS
TEXT-010
SPACE.hi
hope it will help you.
<REMOVED BY MODERATOR>
Refer this link,it will provide u sample code for all.
http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db979035c111d1829f0000e829fbfe/content.htm
PERFORM - parameter_list
Syntax
... [TABLES itab1 itab2 ...]
[USING a1 a2 ...]
[CHANGING a1 a2 ...].
Extras:
1. ... TABLES itab1 itab2 ...
2. ... USING a1 a2 ...
3. ... CHANGING a1 a2 ...
Effect
These additions assign actual parameters to the formal parameters from the parameter interface for the subroutine subr. You can specify all data objects whose data type matches the typing of the corresponding formal parameter (see Check Typing) as actual parameters. Each formal parameter assumes all the properties of the actual parameter assigned to it when it is called.
Addition 1
... TABLES itab1 itab2 ...
Effect
If you specify the addition TABLES, each table parameter t1 t2 ... for the subroutine called that is defined with the addition TABLES to the FORM statement must be assigned an internal table itab as the actual parameter. The assignment of the actual parameters to the formal parameters takes place using their positions in the lists t1 t2 ... and itab1 itab2 ... .
You can only specify standard tables for itab. Transfer takes place by means of a reference. If a specified table itab has a header line, this is also transferred; otherwise, the header line in the corresponding table parameter t is blank when it is called.
Note
Use of table parameters in the interface for subroutines is obsolete but a large number of subroutines have not yet been converted to appropriately typed USING or CHANGING parameters, so that they must still be supplied with data by the TABLES addition to the PERFORM statement.
Example
Static call of the internal subroutine select_sflight transferring a table parameter.
PARAMETERS: p_carr TYPE sflight-carrid,
p_conn TYPE sflight-connid.
DATA sflight_tab TYPE STANDARD TABLE OF sflight.
PERFORM select_sflight TABLES sflight_tab
USING p_carr p_conn.
FORM select_sflight TABLES flight_tab LIKE sflight_tab
USING f_carr TYPE sflight-carrid
f_conn TYPE sflight-connid.
SELECT *
FROM sflight
INTO TABLE flight_tab
WHERE carrid = f_carr AND
connid = f_conn.
ENDFORM.
Addition 2
... USING a1 a2 ...
Addition 3
... CHANGING a1 a2 ...
Effect
If you specify the additions USING and CHANGING, an actual parameter a1 a2 ... of the appropriate type must be assigned to each of the formal parameters u1 u2 ... and c1 c2 ... defined with the same additions to the FORM statement. The actual parameters specified after USING and CHANGING form one shared list. They are assigned to the formal parameters after the position in the shared list. The type of parameter transfer is defined with the additions USING and CHANGING to the FORM statement. The addition USING must be before CHANGING. Otherwise, the assignment of the actual parameters to the additions USING and CHANGING is irrelevant to the PERFORM statement. It is also irrelevant whether only one or both of the additions is specified.
Notes
For the sake of program documentation, we advise that you specify the additions USING and CHANGING in the FORM statement according to the definition of the parameter interface.
In non-Unicode programs, you can address memory area outside an actual parameter if an actual parameter a1 a2 ... is assigned offset or length specifications. In non-Unicode programs, the length is set to the length of the current parameter if an offset is specified without a length. Both of these lead to warnings in the syntax check and to syntax errors in Unicode programs. The rules for the ASSIGN statement apply to the addressable memory area in non-Unicode programs as well.
Example
The following five PERFORM statements mean the same but only the fourth is recommended, since it is the only one that documents the interface of the subroutine called.
DATA: a1 TYPE string,
a2 TYPE string,
a3 TYPE string,
a4 TYPE string.
PERFORM test USING a1 a2 a3 a4.
PERFORM test CHANGING a1 a2 a3 a4.
PERFORM test USING a1 CHANGING a2 a3 a4.
PERFORM test USING a1 a2 CHANGING a3 a4.
PERFORM test USING a1 a2 a3 CHANGING a4.
FORM test USING p1 TYPE string
p2 TYPE string
CHANGING value(p3) TYPE string
value(p4) TYPE string.
ENDFORM.
Edited by: Alvaro Tejada Galindo on Jan 29, 2008 10:07 AM -
hai friends ,
i am sorry.the coding has benn changed little bit now.
the perform in se71 is.
PERFORM SUB_FORM2 IN PROGRAM ZSSS_NEW
USING &EKKO-EBELN&
CHANGING &L_KBERT&
ENDPERFORM
FORM sub_form2 TABLES in_tab STRUCTURE itcsy
out_tab STRUCTURE itcsy.
TYPES : BEGIN OF ty_itab,
kschl TYPE konv-kschl,
kbetr TYPE konv-kbetr,
END OF ty_itab.
DATA : t_itab TYPE STANDARD TABLE OF ty_itab,
wa_itab TYPE ty_itab.
DATA :
l_knumv TYPE knumv,
l_ebeln TYPE ebeln.
break damlek.
READ TABLE in_tab WITH KEY name = 'EKKO-EBELN'.
IF sy-subrc = 0.
l_ebeln = in_tab-value.
ENDIF.
SELECT SINGLE knumv FROM ekko INTO l_knumv WHERE ebeln = l_ebeln.
if not l_knumv is initial.
SELECT kschl kbetr
FROM konv
INTO corresponding fields of table t_itab
where knumv = l_knumv.
endif.
break damlek.
if sy-subrc = 0.
loop at t_itab into wa_itab.
READ TABLE out_tab with key = 'KONV-KNUMV'.
out_tab-value = wa_itab-kbetr.
modify out_tab.
endif.
now here upto itab i am gettinfg the value of kbert,but i want to populate it into out_tab so that i can print it in po.
plz give me the solution.Ok,..I think u are populating data into wrong parameter, name should be L_KBERT not KONV-KNUMV.
Check this modified code:
PERFORM SUB_FORM2 IN PROGRAM ZSSS_NEW
USING &EKKO-EBELN&
CHANGING &L_KBERT&
ENDPERFORM
FORM sub_form2 TABLES in_tab STRUCTURE itcsy
out_tab STRUCTURE itcsy.
TYPES : BEGIN OF ty_itab,
kschl TYPE konv-kschl,
kbetr TYPE konv-kbetr,
END OF ty_itab.
DATA : t_itab TYPE STANDARD TABLE OF ty_itab,
wa_itab TYPE ty_itab.
DATA :
l_knumv TYPE knumv,
l_ebeln TYPE ebeln.
break damlek.
READ TABLE in_tab WITH KEY name = 'EKKO-EBELN'.
IF sy-subrc = 0.
l_ebeln = in_tab-value.
ENDIF.
SELECT SINGLE knumv FROM ekko INTO l_knumv WHERE ebeln = l_ebeln.
if not l_knumv is initial.
SELECT kschl kbetr
FROM konv
INTO corresponding fields of table t_itab
where knumv = l_knumv.
endif.
break damlek.
if sy-subrc = 0.
loop at t_itab into wa_itab.
READ TABLE out_tab with key name = 'L_KBERT'.
out_tab-value = wa_itab-kbetr.
modify out_tab.
endif.
Regards,
Joy. -
How to debugg Subroutine Pool program?
Hi All,
Please tell me how to debugg the subrouting program.
Thanks
Always search before posting basic questions. Also, re-read and spell-check your post before posting
Edited by: kishan P on Aug 30, 2010 2:53 PMHi All,
Please tell me how to debugg the subrouting program.
Thanks
Always search before posting basic questions. Also, re-read and spell-check your post before posting
Edited by: kishan P on Aug 30, 2010 2:53 PM
Maybe you are looking for
-
Remapping Macintosh keyboard for use with XP?
Hi all, I am using a KVM to share my monitor, mouse, and standard white Mac keyboard between the G5 and a Windows XP machine. Been trying to find a simple means of remapping the keys in XP so that things like @ and " are swapped, amongst others. I've
-
ME84: Creation of Releases
Hello, Could anyone help me to find out how we can create releases based on sort order of vendor names? The problem we face is: whenever we create them, they come up with the schedule order number order sequence and it always is a big problem to sort
-
Release reason for blocked sales orders (VKM1 & 3)
We have a business requirement for a mandatory reason when sales orders are released in credit management in the same way that rejected orders have a reason code linked to them. Has anybody else done anything similar?
-
Best way to transfer single point data between loops on FPGA
Hi, I used quite number of loops on FPGA and need to transfer single point datas between loops. Only the current value of data is needed so buffer is not necessary. I don't want use target scope FIFO since it require minimum 21 elements and I onl
-
JavaScript (JS) To Maximize InDesign CS4 Application
I'm trying to write a JavaScript that will maximize the InDesign CS4 application window. I can control the document windows, but haven't found a way to control the application window. Any suggestions?