Application Development 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: 

how to find date field in a BDCDATA table

Former Member
0 Kudos
213

Hi,

Actually i am creating a BOR method,

which in turn calls the FM call_transaction_from_table

i am having my screen info in the table T_BDCDATA which is of type BDCDATA. But my problem is before calling FM i have to change the date format. how to check which field is the date field in T_BDCDATA

please reply.......

Edited by: saritha N on Jan 16, 2008 12:20 PM

Edited by: saritha N on Jan 16, 2008 12:35 PM

1 ACCEPTED SOLUTION

ThomasZloch
Active Contributor
0 Kudos
152

the easiest way would be obviously while T_BDCDATA is being filled.

afterwards the only way I could think of is to use the value in BDCDATA-FNAM, split that into table/structure and field name, then look this up in DD03L. if DD03L-INTTYPE = "D", there you go, it's a date field. This only works if the field on the dynpro has a DDIC reference, of course.

Cheers

Thomas

6 REPLIES 6

Former Member
0 Kudos
152

hi Saritha, check this.

Defining Methods in the BOR Using the BOR/BAPI Wizard

Prerequisites

If the function module which your BAPI is based on has been fully implemented or modified you can define it as a method of an SAP business object type or SAP interface type in the Business Object Repository (BOR). You use the BOR/BAPI Wizard to do this.

Procedure

First find the relevant SAP business object type in the BOR:

Choose Tools ® Business Framework ® BAPI Development ® Business Object Builder.

On the initial Business Object Builder screen you can directly access the SAP business object type or interface type if you know the technical name of the object (object type). You have already identified the technical name of the object.

Otherwise choose Business Object Repository.

To display object types, in the next dialog box indicate whether you want to display all object types or only business object types. Then choose Continue.

To display SAP interface types, in the next dialog box choose Other settings and then select Interface.

The application hierarchy is displayed. Search for the required business object type or interface type in the application hierarchy and double click it to open it.

When the business object type or interface type is displayed, choose Change.

Creating BAPIs as Methods of Business Object Types or Interface Types

To define your BAPI as a method of a business object type or interface type:

Select Utilities ® API Methods ® Add method.

In the next dialog box enter the name of the function module, for example, BAPI_COMPANYCODE_GETDETAIL, and choose Continue.

In the next dialog box specify the following information for the method to be defined:

Method

A default name for the method is provided, based on the name of the function module. You may have to modify the suggested name:

Example: If the name of the function module is SALESORDER_GETSTATUS, the suggested method name might be BapiSalesorderGetstatus. You should edit this so that the resulting name is GetStatus.

Texts

Enter meaningful descriptions for your BAPI.

Radio buttons Dialog, Synchronous

Enter relevant details for your BAPI. Make sure that a BAPI is not dialog orientated. BAPIs are usually implemented synchronously.

Choose Next Step.

A list of parameters and default names is displayed which you need to edit as required. Modify the parameter names as follows:

Each new word in the parameter name must start with a capital letter, for example, CompanyCodeDetail.

Make sure that the parameter names of the method in the BOR are identical to the parameter names in the function module except for the upper/lower case letters.

The import and export behavior of the table parameters must be correctly defined in the BOR.

Reason : In contrast to the function module, in the BOR you can differentiate between import and export for tables also. You should therefore only select the standard option Import/export, if the table is actually going to be imported and exported.

The return parameter is always defined as an export parameter.

Choose Next Step.

To create the method choose Yes in the next dialog box.

Result

After the program has been generated and executed, check that all the definitions have been made correctly by the BOR/BAPI Wizard. To do this, look at the newly created method of the business object type or interface type.

The BOR/BAPI Wizard is used only to create new BAPIs for the first time. It is not used to make changes to existing BAPIs.

If you make changes to the underlying function module after you have created the BAPI in the BOR, for example, if you make compatible interface enhancements or modify short texts, such changes do not automatically take effect in the BOR. You have to make these changes manually in the BOR.

Open that Business object in SWO1 in change mode and put cursor on 'method', select 'create' from top bar , u will get a message asking to create bu template select NO, enter name of method.

Check the check boxes in the 3 tabs (General, Result type, ABAP) as requied. See F1 help for all.

To create parameters select that method and select parameters from top.

To write code select that method and click on program.

save and activate also change the satus of method to implemented.

kindly reward if found helpful.

cheers,

Hema.

ThomasZloch
Active Contributor
0 Kudos
153

the easiest way would be obviously while T_BDCDATA is being filled.

afterwards the only way I could think of is to use the value in BDCDATA-FNAM, split that into table/structure and field name, then look this up in DD03L. if DD03L-INTTYPE = "D", there you go, it's a date field. This only works if the field on the dynpro has a DDIC reference, of course.

Cheers

Thomas

0 Kudos
152

Hi Thomas,

can you please explain this how to do?

Regards,

0 Kudos
152

here's my reply again in pseudo code, just translate this into ABAP:

loop at T_BDCDATA
  split T_BDCDATA-FNAM at "-" into TABLE and FIELD
  select INTTYPE from DD03L where TABNAME = TABLE and FIELDNAME = FIELD
  if INTTYPE = "D"
    convert T_BDCDATA-FVAL as per your requirement
  endif
endloop

Cheers

Thomas

0 Kudos
152

Hi Thomas,

Thank you so much for your help.

This has solved my problem.

Thank you once again.

Regards,

Saritha.

0 Kudos
152

you're welcome.

I wish everybody was so specific in describing their problems and so polite after answers have been received.

Good luck

Thomas