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

Sample coding for BAPIs to replace BDC recording

Former Member
0 Likes
765

When doing recording in MSC1N or MSC2N. Its stuck at classification screen.

Therefore, transaction MSC1N or MSC2N cannot support BDC recording. So, have to use BAPIs to serve the purpose.

Can anyone show me the sample code for doing it? I think BAPIs related are :

1) BAPI_OBJCL_GET_KEY_OF_OBJECT

2) BAPI_OBJCL_GETCLASSES_KEY

3) BAPI_OBJCL_GETDETAIL

4) BAPI_OBJCL_CHANGE

I would like to request for the sample coding for the suggestion? how those BAPIs works without BDC recording? Thanks.

Thanks & Regards

Edited by: Elaine Tang on Feb 3, 2009 4:21 AM

3 REPLIES 3
Read only

Former Member
0 Likes
599
Read only

Former Member
0 Likes
599

Try this out and let me know..

REPORT ztv_test NO STANDARD PAGE HEADING LINE-SIZE 500.

DATA: git_bapi1003 TYPE TABLE OF bapi1003_alloc_values_num,
      git_values_char TYPE TABLE OF bapi1003_alloc_values_char,
      git_values_curr TYPE TABLE OF bapi1003_alloc_values_curr,
      git_bapiret2 TYPE TABLE OF bapiret2,
      ls_bapiret2 TYPE bapiret2.

DATA: gs_bapi1003 TYPE bapi1003_alloc_values_num,
      gs_values_char TYPE bapi1003_alloc_values_char,
      gs_values_curr TYPE bapi1003_alloc_values_char,
      gc_flag_x(1) TYPE c VALUE 'X'.

      gs_values_char-charact = 'VIEWS_ID'. "Characteristics
      
      gs_values_char-value_char = '012'. "characteristics value
      
      APPEND gs_values_char TO git_values_char.

      CALL FUNCTION 'BAPI_OBJCL_CHANGE'
      
        EXPORTING
          objectkey = '1100000028' "Customer
          objecttable = 'KNA1'
          classnum = 'CATALOG_VIEW_CUST' "Class Number
          classtype = '011' "Class Type

        TABLES
            allocvaluesnumnew = git_bapi1003
            allocvaluescharnew = git_values_char
            allocvaluescurrnew = git_values_curr
            return = git_bapiret2.

      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      
        EXPORTING
        
          wait = 'X'
        
        IMPORTING.

Read only

Former Member
0 Likes
599

I got the guidelines from here :

https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/tutorial,MM01UploadusingBAPI

Thanks.