Quantcast
Channel: SCN : All Content - ABAP Connectivity
Viewing all 1442 articles
Browse latest View live

BAPI for Transaction code VL01NO?

$
0
0

Hi

 

Can any one suggest me the available BAPIs for the Tcode VL01NO.

 

Thanks in advance.

 

Phani.


BAPI_COSTCENTER_CREATEMULTIPLE

$
0
0

Hello Guru's,

 

I am facing a problem in BAPI_COSTCENTER_CREATEMULTIPLE while processing... that BAPI is executing fine, but data was not getting updated in D/B table, the program i have enclosed below, please have a look and kindly suggest me what is wrong in that...

 

Helpful Answeres will be Rewarded,

 

&----


*& Report  ZKCZ005R                                                    *

*&                                                                     *

&----


*&                                                                     *

*&                                                                     *

&----


 

REPORT  ZKCZ005R NO STANDARD PAGE HEADING LINE-SIZE 255 LINE-COUNT 64

MESSAGE-ID ZFA.

 

*&----


*&  Tables Declaration

*&----


 

TABLES:T001.

 

*&----


*&  Global Types Declaration

*&----


 

TYPES: BEGIN OF TY_DATA,

        KOSTL TYPE KOSTL,             " Cost center

        VALID_FROM TYPE DATAB,        " From date

        VALID_TO TYPE DATBI,          " To date

        PERSON_IN_CHARGE TYPE VERAK,  " Person

        DEPARTMENT TYPE ABTEI,        " Dept

        COSTCENTER_TYPE TYPE KOSAR,   " cost center type

        COSTCTR_HIER_GRP TYPE KHINR,  " cost center hier

        COMP_CODE TYPE BUKRS,         " company code

        BUS_AREA TYPE GSBER,          " Business area

        PROFIT_CTR TYPE PRCTR,        " Profit center

        LOCK_UPDATE TYPE BKZOB,       " Lock Commit

        CSTG_SHEET TYPE AUFKALSM,     " Costing Sheet

        TITLE TYPE ANRED,             " Addr.title

        TELCO_LANGU TYPE SPRAS,       " Language

        NAME TYPE KTEXT,              " Name

        DESC TYPE KLTXT,              " Description

        MSG(55) TYPE C,               " Message

       END OF TY_DATA.

 

*&----


*&  Work area Declaration

*&----


 

DATA:

     WA_DATA TYPE TY_DATA.

*&----


*&  Internal tables Declaration

*&----


 

DATA: T_DATA TYPE STANDARD TABLE OF TY_DATA INITIAL SIZE 0,

      t_write_list TYPE TABLE OF abaplist.

 

 

************************************************************************

*Global Variables

************************************************************************

 

CONSTANTS: c_yes TYPE xfeld VALUE 'X'.

 

data: v_subrc TYPE sy-subrc,

      v_error_exist TYPE xfeld.

 

*&----


*&  Selection Screen Declaration

*&----


 

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

PARAMETERS: p_test TYPE checkbox DEFAULT 'X'.

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS: rb_file RADIOBUTTON GROUP r1.

SELECTION-SCREEN COMMENT 3(29) FOR FIELD p_file.

PARAMETERS: p_file LIKE rlgrap-filename.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN POSITION 3.

SELECTION-SCREEN COMMENT 3(29) FOR FIELD p_header.

PARAMETERS: p_header(3) TYPE n DEFAULT 1.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS: rb_clbd RADIOBUTTON GROUP r1.

SELECTION-SCREEN COMMENT (28) text-003.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK b2.

PARAMETERS: p_intca TYPE c NO-DISPLAY.  " Internal call

 

 

*----


  • Screen Validations

*----


AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

  PERFORM get_filename USING  p_file.

 

AT SELECTION-SCREEN ON p_file.

  PERFORM validate_filename.

*----


  • Start Of Selection

*----


START-OF-SELECTION.

 

IF p_intca IS INITIAL.

  • Do this because we do not want to lock the material items

  • when using BAPI_GOODSMVT_CREATE. With SUBMIT, the locks

  • on materials will be released

    SUBMIT ZKCZ005R

      WITH p_test = p_test

      WITH rb_file = rb_file

      WITH p_file = p_file

      WITH p_header = p_header

      WITH rb_clbd = rb_clbd

      WITH p_intca = 'X'

      EXPORTING LIST TO MEMORY AND RETURN.

    CALL FUNCTION 'LIST_FROM_MEMORY'

      TABLES

        listobject = t_write_list

      EXCEPTIONS

        not_found  = 1

        OTHERS     = 2.

    IF sy-subrc <> 0.

 

    ENDIF.

    IF NOT t_write_list[] IS INITIAL.

      CALL FUNCTION 'WRITE_LIST'

        TABLES

          listobject = t_write_list.

    ENDIF.

  ELSE.

    CHECK v_subrc IS INITIAL.

    PERFORM upload_data CHANGING v_subrc.

    IF v_subrc IS INITIAL.

      PERFORM CREATE_DATA.

    ENDIF.

  •    PERFORM display_data.

 

ENDIF.

*----


  • End Of Selection

*----


END-OF-SELECTION.

 

  • ----------------------------------------------------------------------

  • SUBROUTINES

&----


&----


*&      Form  get_filename

&----


FORM get_filename  USING pi_file TYPE rlgrap-filename.

  DATA: lv_file  TYPE string,

        li_files TYPE filetable,

        lv_subrc TYPE i,

        lv_title TYPE string VALUE 'File System for Pres. Server'.

 

  lv_file = pi_file.

 

  CALL METHOD cl_gui_frontend_services=>file_open_dialog

    EXPORTING

      window_title            = lv_title

      default_filename        = lv_file

    CHANGING

      file_table              = li_files

      rc                      = lv_subrc

    EXCEPTIONS

      file_open_dialog_failed = 1

      cntl_error              = 2

      error_no_gui            = 3

      OTHERS                  = 4.

 

  READ TABLE li_files INDEX 1 INTO pi_file.

 

ENDFORM.                    " get_filename

&----


*&      Form  validate_filename

&----


FORM validate_filename .

 

  CHECK rb_file = c_yes.

  IF p_file IS INITIAL.

    MESSAGE e318 WITH 'Enter file path name'.

  ENDIF.

 

ENDFORM.                    " validate_filename

 

&----


*&      Form  upload_data

&----


FORM upload_data CHANGING pc_v_subrc TYPE sy-subrc.

  DATA: lv_file TYPE string,

        lv_subrc LIKE sy-subrc,

        lv_tabix TYPE sy-tabix,

        lwa_data TYPE TY_data,

        lt_clip(1024) OCCURS 0 WITH HEADER LINE.

 

  CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'

    EXPORTING

      text = 'Uploading data'(t01).

 

  CLEAR pc_v_subrc.

  REFRESH T_data.

  IF rb_clbd = 'X'.

    CALL FUNCTION 'CLPB_IMPORT'

      TABLES

        data_tab = lt_clip.

    LOOP AT lt_clip.

      CHECK lt_clip NE space.

      CLEAR lwa_data.

      PERFORM asc2dat_konvert

          IN PROGRAM saplgrap USING lt_clip lwa_data lv_subrc.

      APPEND lwa_data TO T_data.

      CLEAR:Lwa_DATA.

    ENDLOOP.

 

  ELSEIF rb_file = 'X'.

    lv_file = p_file.

    CALL FUNCTION 'GUI_UPLOAD'

      EXPORTING

        filename            = lv_file

        filetype            = 'ASC'

        has_field_separator = 'X'

        dat_mode            = 'X'

      TABLES

        data_tab            = t_data

      EXCEPTIONS

        OTHERS              = 4.

 

    IF sy-subrc NE 0.

      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

    ENDIF.

endif.

 

  IF t_data[] IS INITIAL.

    pc_v_subrc = 4.

  ENDIF.

 

ENDFORM.                    " upload_data

 

&----


*&      Form  CREATE_data

&----


FORM CREATE_DATA .

  DATA: lv_tabix TYPE sy-tabix,

        lv_tot_records TYPE i.

    • For BAPI

  DATA : lt_data TYPE TABLE OF BAPI0012_CCINPUTLIST,

         lT_return TYPE TABLE OF bapiret2,

         lv_test TYPE bapi2017_gm_gen-testrun,

         LWA_DATA TYPE BAPI0012_CCINPUTLIST,

         LV_HEADER TYPE BAPI0012_GEN-CO_AREA.

 

 

  IF p_test IS INITIAL.

    CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'

      EXPORTING

        text = 'Posting data'(t02).

  ELSE.

    CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'

      EXPORTING

        text = 'Simulate posting'(t03).

  ENDIF.

 

  lv_test = p_test.

 

 

LOOP AT T_DATA INTO WA_DATA.

 

LWA_DATA-COSTCENTER =  WA_DATA-KOSTL.

LWA_DATA-VALID_FROM =  WA_DATA-VALID_FROM.

LWA_DATA-COMP_CODE = WA_DATA-COMP_CODE.

LWA_DATA-VALID_TO = WA_DATA-VALID_TO.

 

LWA_DATA-PERSON_IN_CHARGE = WA_DATA-PERSON_IN_CHARGE.

LWA_DATA-DEPARTMENT = WA_DATA-DEPARTMENT.

LWA_DATA-COSTCENTER_TYPE = WA_DATA-COSTCENTER_TYPE.

LWA_DATA-COSTCTR_HIER_GRP = WA_DATA-COSTCTR_HIER_GRP.

 

LWA_DATA-BUS_AREA = WA_DATA-BUS_AREA.

LWA_DATA-PROFIT_CTR = WA_DATA-PROFIT_CTR.

LWA_DATA-LOCK_IND_COMMITMENT_UPDATE = WA_DATA-LOCK_UPDATE.

LWA_DATA-CSTG_SHEET = WA_DATA-CSTG_SHEET.

 

LWA_DATA-ADDR_TITLE = WA_DATA-TITLE.

LWA_DATA-TELCO_LANGU = WA_DATA-TELCO_LANGU.

LWA_DATA-NAME = WA_DATA-NAME.

LWA_DATA-DESCRIPT = WA_DATA-DESC.

 

APPEND: LWA_DATA TO LT_DATA.

CLEAR: LWA_DATA,WA_DATA.

 

ENDLOOP.

 

 

LV_HEADER = 'SG01'.

CALL FUNCTION 'BAPI_COSTCENTER_CREATEMULTIPLE'

  EXPORTING

    CONTROLLINGAREA           = LV_HEADER

   TESTRUN                    = ' '

   MASTER_DATA_INACTIVE       = ' '

  TABLES

    COSTCENTERLIST            = LT_DATA

    RETURN                    = LT_RETURN

 

IF SY-SUBRC EQ 0.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

   EXPORTING

     WAIT   = 'X'.

ELSE.

   CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.

ENDIF.

 

ENDFORM.                    " CREATE_data

 

 

.Thanks,

Murali

Alternative to RFC_READ_TABLE

$
0
0

Currently i've managed to get RFC_READ_TABLE to work with my Excel reports. However the RFC only works with one table at a time.

 

Is there an alternative RFC where we can read data from Infosets or Queries?

ALE Configuration Questions

$
0
0

Hello Experts,

 

I have a few questions regarding ALE Configuration, help appreciated

 

1) Is it necessary to create user for ALE transfer in both sender and receiver system ?

2) Is it necessary to create logical system for both sender and receiver in both the systems ?

3) Can tRFC created in sender system have a different port name than the logical system name ?

 

Is it ok, if only configuration is done in the sender system, if I am looking for one way transfer of Idocs from sender to receiver ? The receiver will receive the Idocs and process internally, sender is responsible only for sending in my case.

 

I have referred the below link,

7 Steps For ALE Configuration - ABAP Development - SCN Wiki

 

Best Regards,

Ameya B.

HR to CRM idoc BP not created when i don't send IT 0006

$
0
0

Hi all,

we have an integration between HR and CRM system.when we send all required infotypes from HR to CRM system,then business partner is created succesfully in CRM system.Everyday a job is running  read change pointers and send all infotypes to CRM system.

 

My problem is when hire a person in HR we don't create address infotype (0006) at first, so in CRM system business partners doesn't create. they don't want create address when hire a new person, so i locked.

 

I tried to insert a initial address infotype for a person into idoc_data inbound badi in CRM. but business partner isn't created.

I insert the segments E1PITYP and E1P0006 in idoc data but don't create.

 

how can i solve this problem, any ideas?

 

in inbound badi my code is like this;

 

      add 1 to lv_segnum.

      CLEAR ls_e1pityp.CLEAR wa_idoc_data.

      ls_e1pityp-plvar = '01'.

      ls_e1pityp-otype = 'P'.

      ls_e1pityp-objid = s_pernr-pernr.

      ls_e1pityp-infty = '0006'.

      ls_e1pityp-subty = '1'.

      ls_e1pityp-begda = '18000101'.

      ls_e1pityp-endda = '99991231'.

 

      wa_idoc_data-segnam = 'E1PITYP'.

      wa_idoc_data-sdata  = ls_e1pityp.

      wa_idoc_data-mandt  = s_pernr-mandt.

      wa_idoc_data-docnum = s_pernr-docnum.

      wa_idoc_data-segnum = lv_segnum.

      wa_idoc_data-hlevel = 3.

      wa_idoc_data-DTINT2 = s_pernr-DTINT2.

      wa_idoc_data-psgnum = 1.

      APPEND wa_idoc_data TO idoc_data.

 

      add 1 to lv_segnum.

      CLEAR ls_e1p0006.CLEAR wa_idoc_data.

      ls_e1p0006-pernr = s_pernr-pernr.

      ls_e1p0006-infty = '0006'.

      ls_e1p0006-subty = '1'.

      ls_e1p0006-endda = '99991231'.

      ls_e1p0006-begda = sy-datum.

      ls_e1p0006-aedtm = sy-datum.

      ls_e1p0006-uname = sy-uname.

      ls_e1p0006-anssa = '1'.

      ls_e1p0006-LAND1 = 'EN'.

 

      wa_idoc_data-mandt = s_pernr-mandt.

      wa_idoc_data-docnum = s_pernr-docnum.

      wa_idoc_data-segnam = 'E1P0006'.

      wa_idoc_data-sdata = ls_e1p0006.

      wa_idoc_data-segnum = lv_segnum.

      wa_idoc_data-hlevel = '4'.

      wa_idoc_data-DTINT2 = s_pernr-DTINT2.

      wa_idoc_data-psgnum = lv_psgnum.

 

      APPEND wa_idoc_data to idoc_data.

 

 

Thanks

Idoc should Triggere Material number range

$
0
0

Hi,

 

 

I am going to post standard Idoc sap to sap system , whenever material is created  (MATMAS)  idoc is trigger and post to other system (SAP)

but here i need to restrict idoc creation for material range

 

The  idoc should trigger on number range for Example material is create  with number  1000 between 2000 only in this range idoc should trigger

 

Could you please help me how to achieve the same

 

Thanks in Advance,

Udaya sree.

RFC Error

$
0
0

Hi All,

 

Looking for an advice on why my DEV instance connection to OSS server failed,

I have QAS and PRD connected to the same router string was successful and only DEV instance is failed.

any idea where to start for troubleshoot?

 

Thank you,

 

Regards,

Ura

RFC connection error

$
0
0

Hi,

 

When i am trying to display datasource in source system on BI system, it is showing error message:

Error when opening an RFC connection (CP IC-CALL: 'ThSAPOCMINIT' : cmRc=27 thRc=2)

Message no. RSAR051

Please help me this issue. RFC connection and Source system checking is working fine. RFC registration and every thing fine, still i am getting this error.

 

Thanks & regards,

Surendra


DMARM change pointer not getting created

$
0
0

Hi Experts,

 

Here is an interesting problem I am facing.

 

Change pointers are not getting created in BDCP2 for additional units of measure in additional data tab (MARM OR DMARM table) when I create a new material. They are getting created for changes.

 

Here are the checks already done

 

1) CDHDR and CDPOS changes are already present as Insert

2) BD52 entries are already there for DMARM table and required fields

3) Change document check box is checked for the data elements

4) Change pointers are active for my Z message type and changes are getting recorded for MARA and MARC in BDCP2

 

Please let me know if I am missing any config.

 

Thank you

Outbound Idoc

$
0
0

Hi All,

I am using outbound IDOC SHPMNT05 to process my shipment data, where in i am using the FM - IDOC_OUTPUT_SHPMNT to generate Idocs.

Wherein i have few ZZ fields in VTTK, i have to push those ZZ fields also. Here i have to push the ZZ fields data to the unused fields.

I check the User Exits and BADI, but which are not suitable. Can somebody provide me way to achieve this?

 

Thanks

Internal Table from Web Service's Output is empty

$
0
0

Hi expert,

 

  • I consume a service from integration server,
  • I hope receive feedback in the form of internal table,
  • But I got empty internal table.

 

Below are the screen capture of proxy testing:

 

In "Original Response" I can see the result of "ATTRIBUTLIST",

original response.jpg

But in "Response", the result disappear.

response.jpg

Why this happend and how to solve it?

 

Thank in advance

Function module for data from excel 2007 to sap

$
0
0

Hi all,

 

I have a requirement to upload data from excel 2007 to sap. I tried the function module TEXT_CONVERT_XLS_TO_SAP, but it is failing. I have not used ALSM_EXCEL_TO_INTERNAL_TABLE as it has limitation of uploading data upto 10K records only. So, can anyone please provide a function module name that can support both excel 2007 and 2003 formats. Thank you in advance.

 

Regards,

N.M.S.M.Krishna

Need help for BAPI_PROFITCENTER_CREATE

$
0
0

Hi guys,

 

I am in urgent need of passing the sample data to the Bapi "BAPI_PROFITCENTER_CREATE". As i cannot create BDC for data uploading for the transaction "KE51". I have to use this BAPI any way. I created the test data with my inputs. But i got the following error.

"No language for ISO code 10 in field".

BAPI for transaction J3AH (AFS Master Grid creation)

$
0
0

Hi All,

 

I have to create a AFS master grid from an external file.

 

any one has any idea about BAPI/FM to create the AFS master grid for transaction J3AH?

 

or any other way to create the master grid. Please let  me know.

 

Regards,

Phani.

BGRFC advantages over trfc and qrfc

$
0
0

Hi ,

 

Can anyone tell me what are the advantages of bgrfc over trfc and qrfc if i have to consider bgrfc.

 

Thanks

Akriti


HTTPS error while creating Consumer Proxy

Call Table SUB_HEADER from BAPI1077 GetDetail via VBA

$
0
0

Hello,

 

I have a problem with calling the table SUB_HEADER from the BAPI_BUS1077__GETDETAIL with VBA.

 

I tried that BAPI with SE37 - everything works well.

However, with VBA I cannot find the table SUB_HEADER (the table REFSUBS can be found).

 

My VBA-code:

Dim oMat As Object
Set oMat = SAPBAPIControl1.GetSAPObject("BUS1077")
Dim oRangeSubNr As Object
Set oRangeSubNr = SAPBAPIControl1.DimAs(oMat, "GETDETAIL", "SUB_HEADER")


The Error says:

Parameter SUB_HEADER not found

 

Where is my problem?

I hope, anyone can help me with this problem.

 

Thanks already in advance!

 

Carsten

find idoc number for partner

$
0
0

in WE02, I find the receiving idoc number 24792 in client 800, the partner number shows client 500, how to know the sending idoc number in client 500? thanks

SAP to SAP connection without Middleware (PI)

$
0
0

Hi guys,

 

I would like to ask if someone can give me an overview on how could I establish a connection on a SAP to SAP system without using middleware (PI).

Please provide steps or links if necessary.

 

Hope someone can help me.
Thank you very much in advance.

Create ABAP Proxy error

Viewing all 1442 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>