on 04-06-2009 12:58 PM
Hi Experts,
I am trying to modify the standard invoice smartform as per client requirement.In the payment window, i deleted the fields which are not necessary and I have to print bIll to party address in payment information window. I wrote the code like this in program lines.
CLEAR GS_HD_ADR.
get customer adress number
READ TABLE IS_BIL_INVOICE-HD_ADR INTO GS_HD_ADR
WITH KEY BIL_NUMBER = IS_BIL_INVOICE-HD_GEN-BIL_NUMBER
partn_role = 'RE'.
ADRNR = GS_HD_ADR-ADDR_NO.
DATA : IT_ADRC TYPE STANDARD TABLE OF ADRC with header line
,
WA_ADRC like line of it_ADRC.
*
SELECT * FROM ADRC INTO TABLE IT_ADRC
WHERE ADdrnumber = GS_HD_ADR-ADDR_NO.
read table IT_ADRC INTO WA_ADRC index 1.
Next I Created one text node and I inserted fields like
&wa_adrc-name1&
&wa_adrc-street&.
In SE16 , data is there for name1 and street fields of ADRC table. when I am trying to activate the form , iam getting warning message as field&wa_adrc-name1& has no defined value. In the output, data is not displayed for bill to party address. Please tell me the solution.
hi sekhar,
i already told u that there is no any problem with code.
just check the width of bill to party window.
then try to print it in another window..and check what is happen?
or else.
just check one more time,
se16 vbpaenter vbeln ---u will get adrnr against RE .
take that adrnr aand goto adrc and check there name1 is there .
if it is coming in wa_adrc then just increase the size of window. and check it once
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sekhar!
Could you please eloborate your statement, i mean at types tab wot exactly i have to do?
Actually i've already checked by debugging that the filed is getting the value , but don't know why at the output iam getting zero value.
I've gone thru sap site and got to know that the global definitions presume some defined value and would give warning message sying " field has no defined value" but exactly wot to be done to resolve i culdn't make it.
Thanks in advance......
Regards,
Parwez
Hi Parwez,
Sorry Iam very busy from morning.So,Iam unable to reply .You can ignore the warning messages.
In global definitions, types tab write the following code.
types:begin of ty_adrc,
addrnumber type AD_ADDRNUM,
name1 type AD_NAME1,
street type AD_STREET,
city1 type AD_CITY1,
city_code type AD_CITYNUM,
end of ty_adrc.
types:wa_adrc type table of ty_adrc.
In global data,
it_adrc type table of ty_adrc
wa_adrc type ty_adrc
In the program lines of address window, write this code.
CLEAR gs_hd_adr.
get customer adress number
READ TABLE is_bil_invoice-hd_adr INTO gs_hd_adr
WITH KEY bil_number = is_bil_invoice-hd_gen-bil_number
partn_role = 'RE'.
adrnr = gs_hd_adr-addr_no.
SELECT name1 street city1 city_code FROM adrc INTO corresponding fields of TABLE it_adrc
WHERE addrnumber = gs_hd_adr-addr_no.
loop at it_adrc into wa_adrc.
READ TABLE it_adrc INTO wa_adrc with key addrnumber = gs_hd_adr-addr_no.
endloop.
try with this code
hi ,
now try this code.
global definitions -
it_vbpa like vbpa.
it_adrc like adrc.
select single * from vbpa into it_vbpa where vbeln = IS_BIL_INVOICE-HD_GEN-BIL_NUMBER
and parvw = 'RE'.
select single * from adrc into it_adrc where ADDRNUMBER = it_vbpa-adrnr.
in text node - write &it_adrc-name1& and so on.
first check table vbpa for entries with input vbeln = your invoice no . and parvw = 'RE'.
if entry exist in table vbpa then above code should work .
regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sekhar,
you can ignore this warning message & you can avoid this warning message by providing some default value to &wa_adrc-name1& .
Regards,
Sravanthi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
What code u have written is correct.
Still u try following.
CLEAR GS_HD_ADR.
get customer adress number
READ TABLE IS_BIL_INVOICE-HD_ADR INTO GS_HD_ADR
WITH KEY BIL_NUMBER = IS_BIL_INVOICE-HD_GEN-BIL_NUMBER
partn_role = 'RE'.
ADRNR = GS_HD_ADR-ADDR_NO.
declare adrnr like CADNR in global definitions.
data: it_adrc like adrc . ( no table as there is only one address for bill to party)
select single * from adrc into it_adrc where addrnumber = ADRNR.
Create one text node and I inserted fields like
write : &it_adrc-name1&
&it_adrc-street&
etc.....
regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
It is better to use function module 'ADDR_GET' by providing Address number as input and use that output as address.
Example :
CALL FUNCTION 'ADDR_GET'
EXPORTING
address_selection = sel---->Provide Address number
IMPORTING
sadr = sadr---->Output will be in this structure.
EXCEPTIONS
parameter_error = 1
address_not_exist = 2
version_not_exist = 3
internal_error = 4
OTHERS = 5.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi sekhar,
you need to declare variable in the form interface and if it is structure declare it .
then activate.
Regards,
Vijay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi
you need to declare the field name1 and its type in form interface - import parameter and then activate the form.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sekhar,
You can ignore the warning message and regarding the display of the fields....just put a break-point in the program lines and check in debugging whether the values are getting populated into those fields.
CLEAR GS_HD_ADR.
* get customer adress number
READ TABLE IS_BIL_INVOICE-HD_ADR INTO GS_HD_ADR
WITH KEY BIL_NUMBER = IS_BIL_INVOICE-HD_GEN-BIL_NUMBER
partn_role = 'RE'.
ADRNR = GS_HD_ADR-ADDR_NO.
DATA : IT_ADRC TYPE STANDARD TABLE OF ADRC with header line
,
WA_ADRC like line of it_ADRC.
*
SELECT * FROM ADRC INTO TABLE IT_ADRC
WHERE ADdrnumber = GS_HD_ADR-ADDR_NO.
read table IT_ADRC INTO WA_ADRC index 1.
break-point.
Now when you execute this smart form, the cursor stops at the statement BREAK-POINT. Here you check the work area WA_ADRC whether it is getting populated with values or not.
Regards,
Swapna.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.