cancel
Showing results for 
Search instead for 
Did you mean: 

Question on how to access the Business Logic from a Class

Former Member
0 Kudos

Hi,

I am facing issues while accessing Business Logic in my class. I am using the same types in all the cases(in the class & also in my BSP).

the issue is only coming when I use Business Logic(Select statement) inside a class and if I remove the same, I am getting the things.

My issue is that I am not able to get the value into my BSP from the select statment in the Class.

My BL in the class is as under:

select single zname1

from

zcust_vis

into

eid where zcid = attr1.

attr1 ,zname1 ,zcid and eid are of the same data type.

attr1 is an attribute defined for the class....

BSP looks like this:

call method application->GET_CUSTOMER exporting cid = cust_id

importing eid = c_id.

here above, I was trying to export a value(say 1000) and executing the BL in the class and importing the value of "zname1" into my BSP using but, I could not get any value into the "c_id" parameter....and instead the value is a Blank, and in the table it has got some value and it is not a Blank for the field "zname1".

I hope the problem seems to be clear now... Please let me know what needs to be done to overcome this issue.

Thanks & Regards,

Vishnu.

Accepted Solutions (1)

Accepted Solutions (1)

rainer_liebisch
Contributor
0 Kudos

Hi Vishnu,

let's say your database table zcust_vis has a column zname1 and a column zcid. Now you use the select statement:

select single zname1

from zcust_vis

into eid

where zcid = attr1.

Now eid has to be the same data type as used for zname1 and attr1 has to be the same type as zcid.

To get a value from the select statement you have to fill attr1, so a call from a BSP has to be:

application->GET_CUSTOMER exporting attr1 = 'a value'

importing eid = c_id.

c_id has to be declared in the BSP and has to be of the same type as eid.

Regards,

Rainer

Former Member
0 Kudos

Hi,

Thanks for your response.

I am supplying the value like this:

cust_id = 1000. (in my BSP).

call method application->GET_CUSTOMER exporting cid = cust_id

importing eid = c_id.

But still, the things are not coming up in my BSP.

So please let me know your comments on this.

Thanks & Regards,

Vishnu.

rainer_liebisch
Contributor
0 Kudos

Hi,

you apply a value for cid, but not for attr1. Somewhere you have to fill it before you can start with the select statement.

Regards,

Rainer

Former Member
0 Kudos

Hi,

I am not able to get what you are asking me to do.

When I can see the value in the class(for cid) and assign it to the attribute of the class, I don't see any fault in executing the select statement.

So please kindly let me know "you apply a value for cid, but not for attr1" what it means from your reply.

thanks in advance.

Regards,

Vishnu.

rainer_liebisch
Contributor
0 Kudos

Hi,

in your application class you have cid = 1000, but cid isn't used in your select statment. There you have

select...where zcid = attr1

so it is important to fill the attribute attr1. You need something like attr1 = cid before you can execute the select.

Regards,

Rainer

Former Member
0 Kudos

Hi,

I have already assigned the value of cid to attr1 in the class as under:

attr1 = cid.

and then, I have given the select statement, but still I am not getting....

everything seems ok but, I do not understand why the BL is not working.....

Thanks in advance.

Regards,

Vishnu.

raja_thangamani
Active Contributor
0 Kudos

Put the <b>break-point</b> in

select single zname1

from

zcust_vis

into

eid where zcid = attr1. and check whether eid got the value & sy-subrc is 0 or not after execution of select query.

Raja T

Former Member
0 Kudos

Hi Raja,

Thanks for your answer.

But, I am not able to get into debugging mode while running the BSP Application. And am able to get the return values(only if I do not use a Select Statement in the BL of the Model class) without getting into the debugging mode. Even if I put a debug statment after the Select, I could not get into debugging mode.

So kindly please let me know how to proceed with this case.

Thanks in advance.

Regards,

Vishnu.

raja_thangamani
Active Contributor
0 Kudos

You need to put the external break-point not session break-point.

Also you need to Active External break-point for HTTP. YOu can find this option in

SE80, in

Utilites--> Break-point/External break-point or Utilites--> External break-point --> Set External break-point 

or if you dont find, then

utilities-->setttings -> ABAP Workbench -> look at the debugger tab

& find the external Debugging check box or External Debugging user ID. Give SAP User ID

Also have a look at this..

http://help.sap.com/saphelp_nw2004s/helpdata/en/17/00ab3b72d5df3be10000000a11402f/frameset.htm

<i>* Reward each useful answer</i>

Raja T

Former Member
0 Kudos

Hi Raja,

I have used the break point in the BL in my application class, but, still the debugging thing is not happening...

So please help me out in getting things done through a Business Logic(BL) in the application logic....

thanks in advance.

Regards,

Vishnu.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Vishnu...

Is your application is page with flow logic?

Are you calling this method

<b>call method application->GET_CUSTOMER exporting cid = cust_id

importing eid = c_id.</b>

in OnInputProcessing? and Are your doing something with c_id in OnInitialization?

Regards

Former Member
0 Kudos

Hi Saurabh,

Thanks for the information.

Actually, I using a page with flow logic and I am not using any events but, I was trying to call the method from my Layout itself by using "<% %>" (scriptlet).

Here, I am getting values from the class but, only if I use some manipulation of data (and this is not with a Select statement logic).

If I use a Select statement to get data from a table, I am not able to get the things into the attributes of the class....

So please let me know what needs to be done in this regard and let me also have your experiences over this kind of issue.

Thanks & Regards,

Vishnu.

Former Member
0 Kudos

Hello Vishnu

if your <b> cust_id </b> is string or char type and you are using it in where condition, please check, if it has any leading space. Or better condense this cust_id.

I am not sure whether your select query is working or not. And my thought may be one of the cause.

regards

Saurabh Garg