cancel
Showing results for 
Search instead for 
Did you mean: 

How to implement this in Smartforms

former_member210563
Participant
0 Kudos

Hello,

I have been given this information for what is wanted in a proforma invoice:

Print a field for bankcode. Field name = tempBANKL.

Logic:

Select BANKS BANKL into tempBANKS tempBANKL from T012

where BUKRS = ls_bil_invoice-HD_ORG-COMP_CODE and HBKID = tempHBKID.

What do I need of nodes in my window in order to implement this ?

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi peter,

Please check your code. You have done some incorrect nesting.

Regards,

Subodh

former_member210563
Participant
0 Kudos

The code is exactly as suggested:

Select BANKS BANKL

into (tempBANKS, tempBANKL)

from T012

where BUKRS = ls_bil_invoice-HD_ORG-COMP_CODE

and HBKID = tempHBKID.

Former Member
0 Kudos

hi peter,

I think the query is right. There is something wrong with your code statements written along with this select query.

Please check the entire code where you have written this select query for nesting.

You have not properly nested some other statements.

Regards,

Subodh

former_member210563
Participant
0 Kudos

Hi again,

If I changed the select into a select single it works fine. it is only one record that is to be selected.

Answers (6)

Answers (6)

Former Member
0 Kudos

hi peter,

Try out what rajshekar has suggested. I should be your solution.

I wrongly interpreted your query.

Rajshekar's solution should work.

Regards,

Subodh

Former Member
0 Kudos

Hi

Your select stmnt should be

Select BANKS BANKL

into <b>(tempBANKS, tempBANKL)</b>

from T012

where BUKRS = ls_bil_invoice-HD_ORG-COMP_CODE

and HBKID = tempHBKID.

Regards

Raj

Former Member
0 Kudos

Hi peter,

Please donot mention the field BANKL in slect query twice.

Select BANKS BANKL into tempBANKS

from T012

where BUKRS = ls_bil_invoice-HD_ORG-COMP_CODE and HBKID = tempHBKID.

should work.

Regards,

Subodh

Former Member
0 Kudos

Hello Peter,

I think you need to mention the tempHBKID in the input parameter.

Fill the input parameters with the fields which be used as input (for query).

and mention the fields which you will be displaying in the output in the output parameters tab of INITIALIZATION tab.

Regards,

Subodh

former_member210563
Participant
0 Kudos

Hi,

tempHBKID has already been declared as input. It must be something or somewhere else ...

Former Member
0 Kudos

Hi peter,

did u make the required change in the select query.

I think that should work

Regards,

Subodh

former_member210563
Participant
0 Kudos

Dear Subodh,

Thanks, but it is not working. The error is:

Incorrect expression: 'ENDFUNCTION' in logical expression ?

former_member210563
Participant
0 Kudos

Hmmm. Now I get: Incorrect nesting. Before the statement 'ENDFUNCTION' the structure introduced by SELECT must be concluded with 'ENDSELECT':

Former Member
0 Kudos

Hi

You should have declared the tempHBKID in global parameters. Plz check.

As you are using this in the program code, it needs to be passed as Input/Import.

Regards

Raj

former_member210563
Participant
0 Kudos

Thanks. Of course, global def. The ABAP for the bank code has been made like this:

Select BANKS BANKL

into tempBANKS tempBANKL

from T012

where BUKRS = ls_bil_invoice-HD_ORG-COMP_CODE

and HBKID = tempHBKID.

Now it returns that tempBANKL is not expected. Is it not possible to select data into more than one field in Smartforms ? Sorry for all these questions.

Former Member
0 Kudos

Hi

In the program line node just before the Text node where you need to print the Bank code, pass ls_bil_invoice-HD_ORG-COMP_CODE and tempHBKID as Inputs/Import and tempBANKS and tempBANKL as ouput/Export

In this program line node, you can have your select statement. And, the text node below, will have &tempBANKL& as content.

Regards

Raj

former_member210563
Participant
0 Kudos

Thanks for that. However, when checking the code, I get the following message:

Field TMPHBKID is unknown. It is neither in one of the specified tables nor defined by a DATA statement ?

Is something missing ?