on 09-05-2008 10:02 PM
Hi:
I have a requirement to get vendor address from database and print on the form. I could print only one field only Name1, but not details like Street or country Etc are not getting printed. Even if we pass multiple variables as input and putput variables using perform of form, I think we need to declare only one input as INTTAB STRUCTURE ITCSY and one out put variable as OUTTAB STRUCTURE ITCSY in the ABAP program. In the program I am using Index option like 1, 2 and modifying details of OUTTAB. Is it correct?.
Still I am unable to print complete address on the form.
For this I am unsing Perfom option in the form.
Can you please help in the following:
1) Can I pass one value vendor from form using perform and get back a structure from ABAP program?.
2) I am using following:
DEFINE &VENDOR_NAME& = ' '
DEFINE &VENDOR_STREET& = ' '
PERFORM GET_DATA IN PROGRAM Z_TEST
USING &VENDOR_NO&
CHANGING &VENDOR_NAME&
CHANGING &VENDOR_STREET&
ENDPERFORM.
For Printing I am using inthe form
&VENDOR_NAME&
&VENDOR_STREET&
In the ABAP program I am using
FORM GET_DATA TABLES INTTAB STRUCTURE ITCSY
OUTTAB1 STRUCTURE ITCSY.
IF SY-SUBRC EQ 0.
SELECT SINGLE NAME1 STR_SUPPL1
FROM ADRC
INTO (V_NAME1,V_STR_SUPPL1)
WHERE ADDRNUMBER = V_ADRNR.
IF SY-SUBRC EQ 0.
*
*- Name1
READ TABLE OUTTAB1 INDEX 1.
MOVE V_NAME1 TO OUTTAB1-VALUE.
MODIFY OUTTAB1 INDEX SY-TABIX.
*
*- Street
READ TABLE OUTTAB1 INDEX 2.
MOVE V_STR_SUPPL1 TO OUTTAB1-VALUE.
MODIFY OUTTAB1 INDEX SY-TABIX.
ENDIF.
Can you please check above code and let me know if I am doing mistake anywhere?..like passing variables, printing variables on the form and ABAP sub-routine etc.
Please do not copye again same code what is find in SAP ABAP help.
Thanks in advance for your help.
Thanks,
Rama
Hello,
Assuming that &VENDOR_NO& is the address number I think the following in the SAPScript should result in just printing the NAME1 & STREET values without any extra coding.
/: ADDRESS PRIORITY AP43RTDLC2BNIO LINES 2
/: ADDRESSNUMBER &VENDOR_NO&
/: FROMCOUNTRY 'CA'
/: ENDADDRESS
substitute the country of your choice for 'CA'. B)
Regards,
Michael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
READ TABLE OUTTAB1 INDEX 1.
MOVE V_NAME1 TO OUTTAB1-VALUE.
MODIFY OUTTAB1 INDEX SY-TABIX.
modify outtab1 index 1.
*
Name1
READ TABLE OUTTAB1 INDEX 2.
MOVE V_STR_SUPPL1 TO OUTTAB1-VALUE.
APPEND OUTTAB1
.
make this as
modify outtab1 index 2.
regards
padma
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, replied two times....
Edited by: Karthik D on Sep 6, 2008 10:59 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Instead you can use Address node, if you are trying this in smartform...
Regards
Karthik D
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hmm...is there no transaction to view the form in the foreground mode..?sorry...I am not sure of the online program..
THanks
Naren
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This form is called from F110 which is called in background and executed in 1 to 2 secs time. I tried soft break points and hard break points in ABAP code and the control did not stop....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
The code seems to be good..
Put a break-point in the subroutine of the program...and check what are the values passed in the input and output internal table...and then check where it is failing..
Thanks
Naren
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If my ABAP code is correct(my code looks similar to your code)...then is there is any problem with my SAP FORM-PERFORM code?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Naren:
Your code did not work...
Sorry I did not paste my complete code(when I posted message )as too much code might be confusing. Please find my code below:
FORM GET_DATA TABLES INTTAB STRUCTURE ITCSY
OUTTAB1 STRUCTURE ITCSY.
*
DATA: V_ADRNR LIKE LFA1-ADRNR,
V_NAME1 LIKE ADRC-NAME1,
V_STR_SUPPL1 LIKE ADRC-STR_SUPPL1,
V_LIFNR LIKE LFA1-LIFNR.
*
READ TABLE INTTAB INDEX 1.
V_LIFNR = INTTAB-VALUE.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = V_LIFNR
IMPORTING
OUTPUT = V_LIFNR.
SELECT SINGLE ADRNR
INTO V_ADRNR
FROM LFA1
WHERE LIFNR = V_LIFNR.
*
IF SY-SUBRC EQ 0.
SELECT SINGLE NAME1 STR_SUPPL1
FROM ADRC
INTO (V_NAME1,V_STR_SUPPL1)
WHERE ADDRNUMBER = V_ADRNR.
IF SY-SUBRC EQ 0.
*
*- Name1
READ TABLE OUTTAB1 INDEX 1.
MOVE V_NAME1 TO OUTTAB1-VALUE.
MODIFY OUTTAB1 INDEX SY-TABIX.
*
*- Name1
READ TABLE OUTTAB1 INDEX 2.
MOVE V_STR_SUPPL1 TO OUTTAB1-VALUE.
APPEND OUTTAB1.
ELSE.
READ TABLE OUTTAB1 INDEX 1.
MOVE 'NO NAME' TO OUTTAB1-VALUE.
MODIFY OUTTAB1 INDEX SY-TABIX.
ENDIF.
ENDIF.
ENDFORM.
I am not sure where the mistake can be in the SAP-Form or in the ABAP Subroutine code....
Thanks,
Rama
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please try this..
FORM get_data TABLES inttab STRUCTURE itcsy
outtab1 STRUCTURE itcsy.
* Declarations.
DATA: v_vendor TYPE lfa1-lifnr,
v_adrnr TYPE lfa1-adrnr,
v_name1 TYPE adrc-name1,
v_str_suppl1 TYPE adrc-str_suppl1.
* Get the vendor number.
READ TABLE inttab INDEX 1.
MOVE v_vendor TO outtab1-value.
MODIFY outtab1 INDEX sy-tabix.
* Add leading zeroes.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_vendor
IMPORTING
output = v_vendor.
* Get the vendor address.
SELECT SINGLE adrnr
INTO v_adrnr
FROM lfa1 WHERE lifnr = v_vendor.
IF sy-subrc EQ 0.
SELECT SINGLE name1 str_suppl1
FROM adrc
INTO (v_name1,v_str_suppl1)
WHERE addrnumber = v_adrnr.
IF sy-subrc EQ 0.
*Name1
READ TABLE outtab1 INDEX 1.
MOVE v_name1 TO outtab1-value.
MODIFY outtab1 INDEX sy-tabix.
*Street
READ TABLE outtab1 INDEX 2.
MOVE v_str_suppl1 TO outtab1-value.
MODIFY outtab1 INDEX sy-tabix.
ENDIF.
ENDIF.
ENDFORM. "get_data
Thanks
Naren
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
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.