Regarding subroutine pool
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.
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 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 -
Regarding subroutine in script
hi friends,
i am calling suroutine in script i write in main window of script this
/: PERFORM ZVEND IN PROGRAM ZRFI_CONF_SUB
/: USING &BSIK-LIFNR&
/:USING &BSIK-BUDAT&
/:ENDPERFORM .
i created subroutine pool ZRFI_CONF_SUB.
but when i am debugging form it is not going in that subroutine
where i am wrong plz reply me .
regards,
sonuhi anji,
i am pesting my code plz plz help me plz go through the code .
in script
PERFORM ZVEND IN PROGRAM ZRFI_CONF_SUB
USING &BSIK-LIFNR&
USING &BSIK-BUDAT&
ENDPERFORM
*& Subroutine pool ZRFI_CONF_SUB *
PROGRAM ZRFI_CONF_SUB.
DATA : BEGIN OF I_BSID OCCURS 0,
KUNNR LIKE BSID-KUNNR,
WRBTR LIKE BSID-WRBTR,
BUDAT LIKE BSID-BUDAT,
SHKZG like BSID-shkzg,
BSTAT LIKE BSID-BSTAT,
END OF I_BSID.
DATA : BEGIN OF I_BSAD OCCURS 0,
KUNNR LIKE BSAD-KUNNR,
WRBTR LIKE BSAD-WRBTR,
BUDAT LIKE BSAD-BUDAT,
SHKZG like BSAD-SHKZG,
BSTAT LIKE BSAD-BSTAT,
END OF I_BSAD.
DATA : BEGIN OF I_BSIK OCCURS 0,
LIFNR LIKE BSIK-LIFNR,
WRBTR LIKE BSIK-WRBTR,
BUDAT LIKE BSIK-BUDAT,
shkzg like bsik-shkzg,
BSTAT LIKE BSIK-BSTAT,
END OF I_BSIK.
DATA : BEGIN OF I_BSAK OCCURS 0,
LIFNR LIKE BSAK-LIFNR,
WRBTR LIKE BSAK-WRBTR,
BUDAT LIKE BSAK-BUDAT,
shkzg like bsak-shkzg,
BSTAT LIKE BSAK-BSTAT,
END OF I_BSAK.
*****This is form to get the total in Vendor Bal.ConformationForm*****
FORM ZVEND TABLES IN_BSIK STRUCTURE ITCSY
OUT_BSIK STRUCTURE ITCSY.
data : year(4),
month(2),
day(2),
date(8).
DATA : V_AMNT TYPE P DECIMALS 2,
V_AMT TYPE P DECIMALS 2,
V_TOT TYPE P DECIMALS 2,
V_TOTAL(20),
V_LIFNR(10) TYPE N,
V_BUDAT(10),
V_WRBTR LIKE BSID-WRBTR.
READ TABLE IN_BSIK INDEX 1.
V_LIFNR = IN_BSIK-VALUE.
READ TABLE IN_BSIK INDEX 2.
V_BUDAT = IN_BSIK-VALUE.
year = V_BUDAT+6(4).
month = V_BUDAT+3(2).
day = V_BUDAT+0(2).
CONCATENATE year month day into date.
SELECT LIFNR WRBTR BUDAT SHKZG BSTAT FROM BSIK
INTO table I_BSIK
WHERE LIFNR = V_LIFNR.
SELECT LIFNR WRBTR BUDAT SHKZG BSTAT FROM BSAK
INTO table I_BSAK
WHERE LIFNR = V_LIFNR.
LOOP AT I_BSIK WHERE LIFNR = V_LIFNR.
if i_bsik-BUDAT <= date and i_bsik-bstat ne 'S'.
if i_bsik-shkzg = 'S' .
V_AMNT = V_AMNT + I_BSIK-WRBTR .
else.
V_AMNT = V_AMNT - I_BSIK-WRBTR.
endif.
endif.
ENDLOOP.
LOOP AT I_BSAK WHERE LIFNR = V_LIFNR.
if i_bsak-BUDAT <= date and i_bsak-bstat ne 'S'.
if i_bsak-shkzg = 'S'.
V_AMT = V_AMT + I_BSAK-WRBTR .
else.
V_AMT = V_AMT - I_BSAK-WRBTR.
endif.
endif.
ENDLOOP.
V_TOT = V_AMNT + V_AMT.
V_TOTAL = V_TOT.
READ TABLE OUT_BSIK INDEX 1.
OUT_BSIK-VALUE = V_TOTAL.
MODIFY OUT_BSIK INDEX 1.
ENDFORM. "ZVEND
**This is form to get the total in Customer Bal.Conformation Form*****
FORM ZCUST TABLES IN_BSID STRUCTURE ITCSY
OUT_BSID STRUCTURE ITCSY.
data : year(4),
month(2),
day(2),
date(8).
DATA : V_AMNT TYPE P DECIMALS 2,
V_AMT TYPE P DECIMALS 2,
V_TOT TYPE P DECIMALS 2,
V_TOTAL(20),
V_KUNNR(10) type n,
V_BUDAT(10),
V_WRBTR LIKE BSID-WRBTR.
READ TABLE IN_BSID INDEX 1.
V_KUNNR = IN_BSID-VALUE.
READ TABLE IN_BSID INDEX 2.
V_BUDAT = IN_BSID-VALUE.
year = V_BUDAT+6(4).
month = V_BUDAT+3(2).
day = V_BUDAT+0(2).
CONCATENATE year month day into date.
SELECT KUNNR WRBTR BUDAT SHKZG BSTAT FROM BSID
INTO table I_BSID
WHERE KUNNR = V_KUNNR.
SELECT KUNNR WRBTR BUDAT SHKZG BSTAT FROM BSAD
INTO table I_BSAD
WHERE KUNNR = V_KUNNR.
LOOP AT I_BSID WHERE KUNNR = V_KUNNR.
if i_bsid-BUDAT <= date and i_bsid-bstat ne 'S'.
if i_bsid-shkzg = 'S' .
V_AMNT = V_AMNT + I_BSID-WRBTR .
else.
V_AMNT = V_AMNT - I_BSID-WRBTR.
endif.
endif.
ENDLOOP.
LOOP AT I_BSAD WHERE KUNNR = V_KUNNR.
if i_bsad-BUDAT <= date and i_bsad-bstat ne 'S'.
if i_bsad-shkzg = 'S'.
V_AMT = V_AMT + I_BSAD-WRBTR .
else.
V_AMT = V_AMT - I_BSAD-WRBTR.
endif.
endif.
ENDLOOP.
V_TOT = V_AMNT + V_AMT.
V_TOTAL = V_TOT.
READ TABLE OUT_BSID INDEX 1.
OUT_BSID-VALUE = V_TOTAL.
MODIFY OUT_BSID INDEX 1.
ENDFORM. "ZCUST -
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 -
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,
OrlandoHi 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 -
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 -
Regarding Message Pool In web Dynpro
Hi
I have created the InputForm application for error handling.... In that i have created the Message Pool. A class IMessage<ComponentName> has been genrated automatically. Inside this class whether i have to write the code for create CONSTANT keys or else it will automatically create ... Because i am not getting code inside... its generating empty class.....
like
public class IMessageSimpleErrorsForm{
but i have gone through one application which is already created and deployed.... In that I found the following class for creating CONSTANT keys
public interface IMessageSimpleErrors {
ErrorMessage <code>"Please enter a valid date for field {0}. You entered , which is a date in the future and therefore not a valid date of birth."</code> using
key "DateIsInFuture".
public static final IWDMessage DATE_IS_IN_FUTURE = new WDMessage( "com.sap.tc.webdynpro.tutorial.errorbehavior.IMessageSimpleErrors" , "DateIsInFuture", WDMessageType.ERROR);
Warning <code>"You did not enter an e-mail address. Therefore, you will not be informed about product news and special offers."</code> using
key "DesiredEMail".
public static final IWDMessage DESIRED_E_MAIL = new WDMessage( "com.sap.tc.webdynpro.tutorial.errorbehavior.IMessageSimpleErrors" , "DesiredEMail", WDMessageType.WARNING);
ErrorMessage <code>": Entry of a valid is required for proceeding with the requested service."</code> using
key "MissingInput".
public static final IWDMessage MISSING_INPUT = new WDMessage( "com.sap.tc.webdynpro.tutorial.errorbehavior.IMessageSimpleErrors" , "MissingInput", WDMessageType.ERROR);
please help me
Thanks & Reagards
Ravi Shankar BHi Ravi,
Pay attention that constant are generated only for messages types Standart, Warning and Error but not for Text.
Best regards, Maksim Rashchynski. -
Questions regarding Connection Pooling
Hi
i have some confusion regarding how connection pooling is implemented..i have been doing some digging in to this lately but the more i read the more confused i get. i have some doubts here, will any of the posters here kindly clear them
a. Do i have to connect to my database via the DataSource method to take advantage of the connection pooling provided by my app server?..i have read conflicting information about this suggesting that Connection Pooling will not be provided to my app if i use DriverManager.getConnection()
b. if i chose to use the DataSource method do i have to implement the ConnectionPoolDataSource interface to provide the connection pooling for my app?
c. what is the best way to implement my own custom Connection pool?
ThanxDriverManager.getConnection() literally creates, that is, builds a connection to the database using the values you previously supplied when you loaded the driver.
A connection pool is an object that contains several already made connections to the database, and simply provides you with one of those existing connections. The confusion arises because a) the method name is frequently the same and b) the connection pool object calls the driver's getConnection() method to create several connections before lending any of them out.
In other words:
DriverManager.getConnection() builds a connection to the database.
ConnectionPool.getConnection() fetches an existing connection.
So, to answer your questions...
A. This is correct. If you use DriverManager.getConnection(), you are indeed bypassing the Connection Pool entirely.
B. I'm not familiar with DataSource specifically, but in general, a third party connection pool will either give you the interface (and you implement the details) or they will give you the class file containing the DataSource object. All you would have to do in the latter case is to import that file, then create a new instance of it using the new keyword ( DataSource foo = new DataSource(); ). I suspect DataSource is indeed the class file.
C. Creating a connection pool is trivial and there are many examples of it - search on this forum or check out your favorite Java/JDBC programming book. Usually, the question "Should I use a connection pool and why?" is a more important question. -
Regarding Module Pool Screen Painter
Dear All,
Hi all. When i am using 4.7 i am able to see all the icons like check box .radio buttons,push buttons ,table control and all . There i can drag and drop on the screen easily . I can see this all icons on the left side in the screen painter. In ecc i tried to create a module pool program. In that screen painter i am not able to see these icons in that screen .
When i am clicking on layout on initial screen it is showing ''''EU_SCRP_WN32 : timeout during allocate / CPIC-CALL: 'ThSAPCMRCV' '''' . That is also in text format with some lines and all. I was totally struck here . Please help me in this .
Regards,
Madhu.How can you solve the problem ? Please explain it.
Maybe you are looking for
-
Hi! Some strange things have happened to the mapping file. I have created a new mapping file and have successfully loaded data using that mapping file. Now, I found that if I open the file (source) again and open the mapping file, VALUE mappings for
-
Greetings - I just recently purchased CS5 Production Premium and I want to use Premiere to create slideshows with still camera shots. My source is RAW images (.NEF). I process them in Lightroom 3 and I export them in .Tif or .Psd formats ranging in s
-
I have been give the task of "implementing the Set interface" in Java for a project. I believe what needs to be done is overwriting the methods I need from the Set interface, but I'm not exactly sure if this is correct, or how I would start to do thi
-
Can't see recent backups when trying manual backup or restore
My iphone crashed the second day I had it (2 weeks ago). I immediately did a restore from the summary page in itunes. I have since had other problems caused by an application. All apps and functions working fine right now, except at this point I see
-
Media Manager Problems in FCP--Need Help Quick!
I'm trying to package my short film to send to a color corrector. He wants it packed by "Media Manager," but whenever I try it, it keeps saying "Error, the specified file is locked." Help?