Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

smartforms help

Former Member
0 Likes
2,268

Hi

I am working with lb_bil_invoice,

I want to add the sales organization address into the form.

vbdkr table is defined in the global interface.

I am using vbdkr table for the sales organisation address.

Please tell me how to read the data.

give me the select statement or read statement.

please give me how to debug the smartform.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,139

Ravi,

VBDKR is a strcuture, you will not get any data from there.

VBAK which holds the header data for the sales order, will have the Sales organization VKORG. Take that as the key and fetch the ADRNR (Address Number) from TVKO (Sales ORg Master Table).

You can introduce a PROGRAM LINES object and use this select statement.

<b> SELECT ADRNR INTO W_ADRNR FROM TVKO WHERE VKROG = VBKA-VKORG </b>

Crete a Addressobject in SMART Forms and pass this W_ADRNR variable you have fetched.

That will print the address of the sales org.

Regards,

Ravi

Note :Please mark the helpful answers

Message was edited by: Ravikumar Allampallam

26 REPLIES 26
Read only

Former Member
0 Likes
2,140

Ravi,

VBDKR is a strcuture, you will not get any data from there.

VBAK which holds the header data for the sales order, will have the Sales organization VKORG. Take that as the key and fetch the ADRNR (Address Number) from TVKO (Sales ORg Master Table).

You can introduce a PROGRAM LINES object and use this select statement.

<b> SELECT ADRNR INTO W_ADRNR FROM TVKO WHERE VKROG = VBKA-VKORG </b>

Crete a Addressobject in SMART Forms and pass this W_ADRNR variable you have fetched.

That will print the address of the sales org.

Regards,

Ravi

Note :Please mark the helpful answers

Message was edited by: Ravikumar Allampallam

Read only

0 Likes
2,139

thanks Ravi,

Please tell me vbak has to declare in global interface or form interface.

thanks

Ravi

Read only

0 Likes
2,139

Hi

You don't need VBAK table, you can find the organization sales code in VBDKR structure: it's field VKORG.

Max

Read only

0 Likes
2,139

Ravi,

That depends on what data your are currently passing to the SMART Form. If you are passing just the order number, then you can do this.

Declare a variable W_VKORG

SELECT SINGLE VKORG INTO W_VKORG FROM VBAK

WHERE VBELN = ORDER_NO.

NOw use the W_VKORG to get the ADRNR as specified above.

Regards,

Ravi

Note :Please mark the helpful answers

Read only

0 Likes
2,139

Hi guy

The smartform lb_bil_invoice is std smartform for bill document so all header data are in VBRK table and not in VBAK table (that's for sale order).

Anyway all header data are just in VBDKR structure so it doesn't need to read the VBRK, it's useless.

So all you need is only to declare a variable to store the address id, for example W_ADRNR as Ravi just said.

Max

Read only

0 Likes
2,139

Hi Max,

Thanks,

I am trying the select statement but it is giving syntax error. tvko table is unknown. since it is not declared in the form. please give me the detial information what to delcare in the delcaration.

I am new to Smartforms. This is my first smart form. please give the response since I have to complete this form today.

Thanks in advance.

Ravi.

Read only

0 Likes
2,139

Hi

You have to declare all new global data you need in the global data tab (just under interface section).

So here insert a new variable:

TVKO TYPE TVKO

Then in INITIALIZATION tab you can read it, but you remember to put it in INPUT/OUTPUT parameter of that tab.

So:

Go to Global definition->Global data tab and insert a new entry like this:

TVKO TYPE TVKO

Go to Global definition->Inizialization tab

Insert VBDKR in input parameter

TVKO in output parameter and write the select statament:

SELECT SINGLE * FROM TVKO INTO TVKO WHERE VKORG = VBDKR-VKORG.

Max

Read only

0 Likes
2,139

Ravi,

Can you explain what exactly you are doing?

Like Max said you will have to specify the INPUT AND OUTPUT parameters for the program lines. In this case VKORG (Which ever strcuture it is coming from) is the input parameter and W_ADRNR will be the output.

Inside the code ...

SELECT ADRNR INTO W_ADRNR FROM TVKO WHERE VKORG = structure-VKORG.

Also, please make sure that you mark each of the helpful answers that is helping complete your SMART Form.

Regards,

Ravi

Read only

0 Likes
2,139

Thanks,

Please help me wa_adrnr has to declare as a char.

Please tell how to delcare the wa_adrnr.

Thanks in advance.

Ravi

Read only

0 Likes
2,139

Hi

WA_ADRNR TYPE ADRNR.

Max

Read only

0 Likes
2,139

Thanks max,

This has to delcare in global interface

Read only

0 Likes
2,139

Hi

Yes it has, because in this way it can used in all sections of smartform.

It'd be better to fill it in INITIALIZATION tab.

Max

Read only

0 Likes
2,139

Hi Max,

we are giving condition as vkorg = vbdkr-vkorg in the select statement from where are getting the vkorg value.

Since the standard form doest contain this field

can u please tell me this.

Thanks,

Ravi

Read only

0 Likes
2,139

Which form?

Max

Read only

0 Likes
2,139

LB_BIL_INVOICE.

Read only

0 Likes
2,139

Ravi,

You do have the data.

Do this.

Declare a variable

DATA : WA_ORG TYPE LBBIL_HD_ORG.

In your program lines

WA_ORG = LBBIL_INVOICE-HD_ORG.

Now, sales org is WA_ORG-SALESORG.

In fact you don't even have to fetch the adrnr as the same is available here SALESORG_ADR.

So, all you have to do here is

W_ADRNR = WA_ORG-SALESORG_ADR.

Now use this.

Regards,

Ravi

Note :Please mark all the helpful answers in the thread

Read only

0 Likes
2,139

Hi

All data of bill document are in the IS_BIL_INVOICE parameter of interface.

The data of organization are in HD_ORG structure, so you find the sale org code in IS_BIL_INVOICE-HD_ORG-SALESORG.

But just as Ravi said, here you can find the ID address too: SALESORG_ADR field.

So you don't need to use WA_ADRNR, but you can directly use the field IS_BIL_INVOICE-HD_ORG-SALESORG_ADR.

Max

Read only

0 Likes
2,139

Max,

I gave a separate variable because as such he is confused which parameters need to be used and with a nested structure he will be more confused.

Regards,

Ravi

Read only

0 Likes
2,139

Hi,

This is executing successfully, spool is created.

but when in sp01 it is not displaying any spool number.

can u tell me what is the problem.

Thanks,

Ravi

Read only

0 Likes
2,139

Hi

Perhaps you've setted the option to delete the spool after printing in dialog screen.

Max

Read only

0 Likes
2,139

Thanks Max and Ravi.

I solved the problem

Can u help me finding the fields for the item number, delivery mode, payment terms and payment date

Thanks,

Ravi

Read only

0 Likes
2,139

Hi

All item data are in table with name beginning with IT, for example main data are in IS_BIL_INVOICE-IT_GEN: remember it's a table no structure

- payment terms --> IS_BIL_INVOICE-HD_GEN-TERMS_PAYM

- payment date --> I don't thin you can find that information, you should check account invoice, here you can find document date --> IS_BIL_INVOICE-HD_GEN-BIL_DATE

For delivary data see all field with name begginig with DEL.

Max

Read only

0 Likes
2,139

Thanks Max,

I want to modify the packlist sd_packing_list.

can u help me please.

I made the changes according to the requirements. I want to test it know. I had configured in nace transaction.

Next what i should do to execute it. i have to create sales order?

please tell me what steps i want to continue.

and please tell me how to translate this english version forms to different languages.

Thanks,

Ravi.

Read only

0 Likes
2,139

Ravi,

Please appreciate the time we have spent in helping you and mark all the helpful answers.

Regards,

Ravi

Read only

0 Likes
2,139

Hi

Ravi is right.

You should mark the helpfull answers and open new post for those questions in this way other guys can help you.

Anyway you have to create a delivery (trx VL01N), and so you need to have an order: if you haven'it, create it.

Use trx SE68 to translate your form

Max

Read only

Former Member
0 Likes
2,139

Hi

Get the ID address from TVKO table:

SELECT SINGLE * FROM TVKO WHERE VKORG = VBDKR-VKORG.

Here you can find the id from field ADRNR.

Use a address node to print the address or use the fm ADDR_GET to get all information about address.

Max