‎2006 Feb 23 9:38 PM
Hello everyone:
I have some transactions, is there a way to find some equivalent BAPIS? this transactions are XD03, FD10N and FBL5N.... or at least a way to find out which tables are they accessing?
Thanks!
Alejandro
‎2006 Feb 23 9:52 PM
There is no direct link between transaction code and BAPI. All the transactions you mentioned are display transactions. Do you want the output of these transactions into some internal tables so that you can further use them or do you want to simply call these display transactions from outside SAP?
You can get some of the customer details using BAPI_CUSTOMER_GETDETAIL2. You can look at BAPI_GL_ACC_GETDETAIL for getting GL account details.
Tables are KNA1, KNB1, KNVK, etc for customers. BSID for the customer accounting document lines.
Srinivas
‎2006 Feb 23 9:48 PM
Go to transaction BAPI, you can search for BAPI's there.
For XD03 look at object Customer and BAPI BAPI_CUSTOMER_DISPLAY
‎2006 Feb 23 9:52 PM
There is no direct link between transaction code and BAPI. All the transactions you mentioned are display transactions. Do you want the output of these transactions into some internal tables so that you can further use them or do you want to simply call these display transactions from outside SAP?
You can get some of the customer details using BAPI_CUSTOMER_GETDETAIL2. You can look at BAPI_GL_ACC_GETDETAIL for getting GL account details.
Tables are KNA1, KNB1, KNVK, etc for customers. BSID for the customer accounting document lines.
Srinivas
‎2006 Feb 23 9:57 PM
Hello Srinivas:
Thanks for your response... I'd like to call them from webDynpro... however, I noticed that I couldn't find equivalences... I'm just trying to make sense out of it, I'd like to find my way out instead of asking for every transaction I need to use.... I know what data I need, but some fields appear on the transaction and not on the BAPI... can I get to know where did this data come from using the transaction?
Thanks
Alejandro
‎2006 Feb 24 4:22 AM
BAPIs are created for the purpose of exchanging SAP objects such as customer, vendor etc or even sales order etc with the external applications. Exchanging includes mere data exchange, or even update operations.
Not every external application has the same definition of a customer or a sales order. So in the design of a BAPI, they have taken the approach of what is the minimum required for all these applications to use these objects and what additional information may be desired. So, you will find the BAPIs holding lot less information than what you see on the SAP transaction screens.
But at the same time, if an external application needs to perform update/create/delete operations on some SAP object, then SAP requires more data so that it fits into its transaction logic. So you will see these BAPIs asking for much more information.
If you are calling from Webdynpro, you can always call some of the online BAPIs which will do a direct transaction call to the SAP transaction. I haven't yet started working on it, but with what little I know, I think all transactions can be called from within a webdynpro application.
Srinivas
‎2006 Feb 24 4:23 AM
But if you have specific fields in those transactions that you find the tables for, please let me know.
‎2006 Feb 24 3:32 PM
Thanks Srinivas... I'm using XD03 to get the client details, however, I can't get the "Street 5" field, and also the Fiscal Information.....
About the countries, I get MX, do you know which table should access for its full name equivalence? such in this case, Mexico.
I really appreciate it, I don't really know where to start looking
Thanks
Alex
‎2006 Feb 24 3:36 PM
Hi,
Please check table T005T with LAND1 = MX and you will get MExico at T005T-LANDX.
Regards,
Lanka
‎2006 Feb 24 3:49 PM
Hello Lanka, how did you find this table? I need other "Help tables" ¿, just like the countries one
Thanks
‎2006 Feb 24 3:58 PM
Hi Alex,
Street 5 and other central address administration fields are available in ADRC table and other ADR* tables. The link between ADRC and KNA1 will be ADRNR.
If you go to any of these tables, go to the country field(LAND1), you will see that it has a value/check table of T005. Now if you go to display T005, in the menu, 'Go To-->Text Table' will take you to the corresponding descriptions table.
Srinivas
‎2006 Feb 24 4:10 PM
I'm sorry I didn't get the last part... for instance, I have table KNB1 and one field ZTERM has code 0001. That code means "Available for 30 days". That would be an equivalence in another table. I need to find that table tough =(
Also, I didn't find table ADRNR
‎2006 Feb 24 4:17 PM
Hi ,
Please note that the payterms were maintained differently in SAP.
For your purpose please check table T052U with key as ZTERM = KNB1-ZTERM and SPRAS = LANGUAGE that you are you are using.
Regards,
Lanka
‎2006 Feb 24 4:17 PM
KNA1 has a field ADRNR which links to ADRC to give you all the address details.
ZTERM(payment terms) are in another table(T052). T052U has the descriptions.
‎2006 Feb 24 4:30 PM
That's the table, however, on XD03 I have ZTERM 0001 and it says: "PAY INMEDIATELY WITHOUT DPP" and on table T052U the same entry has no text.... the closest text goes with entry D001
Thanks!
Alex
‎2006 Feb 24 4:34 PM
You have to use the function module FI_TEXT_ZTERM.
Even better is use function module FI_PRINT_ZTERM.
Message was edited by: Srinivas Adavi
‎2006 Feb 24 4:37 PM
Hi,
Please check table view : V_T052 or use function module :
*--Get Own explanation from view V_T052
CALL FUNCTION 'FI_PRINT_ZTERM'
EXPORTING
I_ZTERM = XD03-ZTERM
I_LANGU = SY-LANGU
I_XT052U = 'X'
TABLES
T_ZTEXT = T_ZTEXT.
Regards,
Lanka
‎2006 Feb 24 4:49 PM
where do I place that code?
I have this code already working:
FUNCTION Z_SAP_GET_CREDIT.
*"----------------------------------------------------------------------
*"*"Interfase local
*" IMPORTING
*" VALUE(CLIENT_ID) TYPE Z_CLIENT_ID OPTIONAL
*" EXPORTING
*" VALUE(CREDIT_LIMIT) TYPE KNB1-WEBTR
*" VALUE(CONDITIONS) TYPE KNB1-ZTERM
*" EXCEPTIONS
*" USER_DOES_NOT_EXIST
*"----------------------------------------------------------------------
TYPES: BEGIN OF credit_eq_type,
WEBTR LIKE KNB1-WEBTR,
ZTERM LIKE KNB1-ZTERM,
END OF credit_eq_type .
DATA: credit_eq TYPE credit_eq_type.
CONSTANTS BU LIKE KNB1-BUKRS value 'FSMX'.
call function 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = CLIENT_ID
IMPORTING
OUTPUT = CLIENT_ID.
SELECT SINGLE WEBTR ZTERM
FROM KNB1
INTO credit_eq
WHERE KUNNR = CLIENT_ID.
CREDIT_LIMIT = credit_eq-WEBTR.
CONDITIONS = credit_eq-ZTERM.
ENDFUNCTION.
I would assume that the transformation should be places after the CONDITIONS last assignment.
Thanks
Alejandro
‎2006 Feb 24 5:24 PM
No that wont work. Your 'CONDITIONS' is defined like KNB1-ZTERM where as the texts are returned from the function module in the tables parameter defined as below.
T_ZTEXT STRUCTURE TTEXT.
So you need to add a tables parameter with the same structure. Then in your code, after your SELECT statement, call the function module with I_ZTERM = credit_eq-ZTERM and T_ZTEXT = <your function module's tables parameter>.
Srinivas
‎2006 Feb 24 6:01 PM
Why can I just get the 001 value I already have, and make another SELECT using that value?
Gosh why can I just use C!
Thanks
Alex
‎2006 Feb 24 7:04 PM
Hi,
If you use Function module for ZTERM text then you have to declare internal tables .
*--Get Own explanation from view V_T052
CALL FUNCTION 'FI_PRINT_ZTERM'
EXPORTING
I_ZTERM = ZXEKKO-ZTERM
I_LANGU = L_LANGU
I_XT052U = 'X'
TABLES
T_ZTEXT = T_ZTEXT.
Then use Read statement to pass the text to a string.
Read table T_ZTEXT index 1.
Z_TEXT_TERM = T_ZTEXT-TEXT1.
Or Use Select statement by using view V_T052
Regards,
Lanka
‎2006 Feb 24 9:19 PM
Because what you are getting from one table(KNB1) is just the code(001) and what you actually want is the text which is what you will get using the function module. Even if you use C I guess you have to make similar selects if the database is designed in such a way that codes are stored in one place and texts are in another place!!!
‎2006 Feb 24 9:26 PM
I believe it's a matter of naming.... so basically I get the code and there's no SELECT FROM WHERE code = mycode Table I could use... I need to go through a function module, and functions modules (or at least this one) needs not a flat input, but a table
Thanks for your patience!! hehe
Alejandro
‎2006 Feb 24 9:30 PM
The table has only one text, but the function module sometimes returns more than that because of how the payment terms are set up. Depending on configuration, some additional lines of texts will be added to the text existing in that table. So what you see in the table need not always be the complete text for a payment term. That is reason for using a table instead of a string. If you look through the code of this function module, you will see that it appends other text lines(kind of hardcoded text lines) to the one selected from the table.
Hope this clarifies,
Srinivas
‎2006 Feb 24 10:06 PM
Again.... I'd like to fully understand it (rather than having someone writting my code). I think that this will bringme the string I need:
CALL FUNCTION 'FI_PRINT_ZTERM'
EXPORTING
I_ZTERM = credit_eq-ZTERM
I_LANGU = LANGUAGE
I_XT052U = 'X'
TABLES
T_ZTEXT = MY_TEXT.
It will be placed on a table called MY_TEXT right? I can read it afterwards.... but how should I create that table? I've looking for "internal tables creation" but I find it way too complex and I don't think that's what I need is that so?
Thanks again! Alejandro
‎2006 Feb 25 12:32 AM
You still have to declare MY_TEXT somewhere in the code or it should be your function module's tables parameter. If you did that, yes, then the text will be available for you to read. Imagine the internal tables as arrays in C.