Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all 8332 articles
Browse latest View live

ALV Report to slow

$
0
0

Hi,

 

I am developing a report in ALV but report is too slow, as its using three loops(Loop inside a loop), kindly suggest how to make the report fast, as I have tried using Read statement for 2 loops but data is not coming correctly, One of my friend suggested to u use field symbol, But I don't have much knowledge about the field symbols, kindly suggest how to modify the report to make it faster.

 

Here's the code ...

 

 

FORM FETCH_DATA .

 

   IFNOT P_CHECK ISINITIAL.

 

  if it_vttk[] isNOTINITIAL.

   SELECT  ROUTE KNANF  KNEND

     FROM TVRAB

     INTOTABLE IT_ROUTE

     FORALL ENTRIES IN IT_VTTK

       WHERE ROUTE = IT_VTTK-ROUTE.

 

     IF SY-SUBRC ISINITIAL.

     SELECT  VBELN TKNUM

      FROM VTTP

      INTOTABLE IT_VTTP

      FORALL ENTRIES IN IT_VTTK

      WHERE TKNUM = IT_VTTK-TKNUM.

 

     IF SY-SUBRC ISINITIAL.

 

         SELECT VBELN KUNNR PARVW

         FROM VBPA

         INTOTABLE IT_KUNNR

         FORALL ENTRIES IN IT_VTTP

         WHERE VBELN = IT_VTTP-VBELN

         AND ( PARVW = 'AG'

         OR PARVW = 'SL' ).

 

        if it_kunnr[] isNOTINITIAL.    "added by Sonam

        SELECT KUNNR NAME1

        FROM KNA1

        INTOTABLE IT_KNA1

        FORALL ENTRIES IN IT_KUNNR

        WHERE KUNNR = IT_KUNNR-KUNNR.

        ENDIF.

 

         SELECT VBELN POSNR matnr VGBEL  VGPOS mtart AESKD

         FROM LIPS

         INTOTABLE  IT_LIPS

         FORALL ENTRIES IN IT_VTTP

         WHERE  VBELN = IT_VTTP-VBELN.

 

         IF SY-SUBRC ISINITIAL.

 

           SELECT VBAP~VBELN VBAP~POSNR VBAK~KNUMV vbak~auart      "vbap~matnr

            FROM VBAK INNER JOIN VBAP ON VBAK~VBELN = VBAP~VBELN

            INTOTABLE IT_VBAK

             FORALL ENTRIES IN IT_LIPS

             WHERE VBAP~VBELN = IT_LIPS-VGBEL

              AND VBAP~POSNR = IT_LIPS-VGPOS

             and vbak~auart in so_auart.

 

 

             if sy-subrc isINITIAL.

 

           SELECT KNUMV KPOSN KSCHL KWERT

              FROM KONV

              INTO  TABLE IT_KONV

*             FOR ALL ENTRIES IN IT_VBRP

              FORALL ENTRIES IN IT_VBAK

              WHERE KNUMV = IT_VBAK-KNUMV.

               endif.

 

      select vbeln posnr vgbel vgpos aubel NETWR NTGEW BRGEW MVGR1 PRODH

         from vbrp

          intotable it_vbrp

          forall entries in IT_LIPS

           where vgbel =  IT_LIPS-VBELN

               AND VGPOS = IT_LIPS-POSNR.

 

       if it_vbrp[] isnotINITIAL.

         SELECT vbeln bstnk_vf

           FROM vbrk

           intoTABLE it_vbrk

           FORALL ENTRIES IN it_vbrp

           WHERE vbeln =  IT_VBRP-VBELN

            AND  SFAKN eq SPACE

            AND  FKSTO NE'X'.

       endif.

       ENDIF.

     ENDIF.

 

   ENDIF.

     else.

     MESSAGE'NO RELEVANT VALUE EXIST FOR THIS'TYPE'E'.

  endif.

   DATA: L_TEU TYPEI,

         LV_PRODH TYPEC LENGTH 10,

         LINESTYPETABLEOF TLINE,

         WA_LINE TYPE TLINE,

         L_NAME TYPE THEAD-TDNAME.

 

   SORT: IT_VTTP[] BY TKNUM," VBELN,

         IT_VTTK[] BY TKNUM ,"ROUTE,

         IT_LIPS[] BY VBELN," POSNR, "VGBEL VGPOS,

         IT_VBRP[] BY VGBEL VGPOS,

         IT_VBRK[] BY VBELN,

         IT_VBAK[] BY VBELN POSNR," POSNR KNUMV,

*        IT_VBKD[] BY VBELN,

         IT_ROUTE[] BY ROUTE,

         IT_KUNNR[] BY VBELN,

         IT_KNA1[] BY KUNNR,

         IT_KONV[] BY KNUMV KPOSN KSCHL.

 

LOOPAT IT_VTTK  INTO WA_VTTK.

LOOPAT IT_VTTP INTO WA_VTTP WHERE TKNUM = WA_VTTK-TKNUM.

LOOPAT IT_LIPS INTO WA_LIPS WHERE VBELN = WA_VTTP-VBELN.

     READTABLE IT_VBRP INTO WA_VBRP WITHKEY VGBEL = WA_LIPS-VBELN VGPOS = WA_LIPS-POSNR BINARYSEARCH.

     IF SY-SUBRC ISINITIAL.

       READTABLE IT_VBRk INTO WA_VBRk WITHKEY vbeln = WA_VBRP-vbeln BINARYSEARCH.

      endif.

     READTABLE IT_VBAK INTO WA_VBAK WITHKEY VBELN = WA_LIPS-VGBEL  POSNR = WA_LIPS-VGPOS BINARYSEARCH.

 

     IF SY-SUBRC ISINITIAL.

 

     READTABLE IT_ROUTE INTO WA_ROUTE WITHKEY ROUTE = WA_VTTK-ROUTE BINARYSEARCH.

     READTABLE IT_KUNNR INTO WA_KUNNR WITHKEY VBELN = WA_VTTP-VBELN PARVW = 'AG'BINARYSEARCH.

     if sy-subrc isINITIAL.

      READTABLE IT_KNA1 INTO WA_KNA1 WITHKEY KUNNR = WA_KUNNR-KUNNR BINARYSEARCH.

     endif.

     READTABLE IT_KUNNR INTO WA_KUNNR1 WITHKEY VBELN = WA_VTTP-VBELN PARVW = 'SL'BINARYSEARCH.

     if sy-subrc isINITIAL.

     READTABLE IT_KNA1 INTO WA_SL WITHKEY KUNNR = WA_KUNNR1-KUNNR BINARYSEARCH.

     endif.

     CONCATENATE WA_VBAK-VBELN WA_VBAK-POSNR INTO L_NAME.

           REFRESH: lines.

           CALLFUNCTION'READ_TEXT'

             EXPORTING

              CLIENT                        = SY-MANDT

               ID                            = '0001'

               LANGUAGE                      = 'E'

               NAME                          = L_NAME

               OBJECT                        = 'VBBP'

 

             TABLES

               LINES                         = LINES

           EXCEPTIONS

             ID                            = 1

             LANGUAGE                      = 2

             NAME                          = 3

             NOT_FOUND                     = 4

             OBJECT                        = 5

             REFERENCE_CHECK               = 6

             WRONG_ACCESS_TO_ARCHIVE       = 7

             OTHERS                        = 8

                     .

           IF SY-SUBRC <> 0.

* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

           ENDIF.

 

           else.

             MESSAGE'NO RELEVANT VALUE EXIST FOR THIS'TYPE'E'.

             LEAVETO LIST-PROCESSING.

             endif.

 

 

           READTABLELINESINTO WA_LINE INDEX1.

 

           "Loop for every Billing Condition Number and

 

           READTABLE IT_KONV INTO WA_KONV WITHKEY KNUMV = WA_VBAK-KNUMV

                   KPOSN = WA_VBAK-POSNR

                  KSCHL = 'ZFR0'BINARYSEARCH              .    "Freight Charges

 

           if sy-subrc ne0.

             READTABLE IT_KONV INTO WA_KONV WITHKEY KNUMV = WA_VBAK-KNUMV

                   KPOSN = WA_VBAK-POSNR

                  KSCHL = 'ZFR1'  BINARYSEARCH             .    "Freight Charges

           endif.

 

*    IF ls_konv-kschl = 'ZFR0'.  "FOR FREIGHT CHARGES

           READTABLE IT_KONV INTO WA_KONV_ZD01

               WITHKEY KNUMV = WA_VBAK-KNUMV

                        KPOSN = WA_VBAK-POSNR

                        KSCHL = 'ZD01'BINARYSEARCH.

           if sy-subrc ne0.

                READTABLE IT_KONV INTO WA_KONV_ZD01

               WITHKEY KNUMV = WA_VBAK-KNUMV

                        KPOSN = WA_VBAK-POSNR

                        KSCHL = 'ZD03'BINARYSEARCH.

           endif.

           READTABLE IT_KONV INTO WA_KONV_ZD02

               WITHKEY KNUMV = WA_VBAK-KNUMV

                        KPOSN = WA_VBAK-POSNR

                        KSCHL = 'ZD02'BINARYSEARCH.

           if sy-subrc ne0.

             READTABLE IT_KONV INTO WA_KONV_ZD02

               WITHKEY KNUMV = WA_VBAK-KNUMV

                        KPOSN = WA_VBAK-POSNR

                        KSCHL = 'ZD04'BINARYSEARCH.

 

           endif.

           READTABLE IT_KONV INTO WA_KONV_ZSTB

               WITHKEY KNUMV = WA_VBAK-KNUMV

                        KPOSN = WA_VBAK-POSNR

                        KSCHL = 'ZSTB'BINARYSEARCH.

*Discounted Total = Frieight - Discount1 - Discount2

           WA_FINAL-ZFR0 =   WA_KONV-KWERT

                              + WA_KONV_ZD01-KWERT   "Added as it is a -ve amt

                              + WA_KONV_ZD02-KWERT.

*Tax = Ser.Tax basis Reven

           WA_FINAL-TAX = WA_KONV_ZSTB-KWERT.

 

           LOOPAT  IT_KONV INTO WA_KONV_THC WHERE  KNUMV = WA_VBAK-KNUMV

                                 AND       KPOSN = WA_VBAK-POSNR

                               AND ( KSCHL = 'ZTH0'OR KSCHL = '0ZTH'        "Ter. HandlINGg ChrgES

                                OR KSCHL = 'ZTH1'OR KSCHL = '1ZTH'

                                OR KSCHL = 'ZTH3'OR KSCHL = 'ZTH4') .

 

 

             IF ( WA_KONV_THC-KSCHL = 'ZTH0'OR WA_KONV_THC-KSCHL = '0ZTH'

                                             OR WA_KONV_THC-KSCHL = 'ZTH4'). "FOR TER handling CHARGES - ZTH0 and 0ZTH

               WA_FINAL-ZTH0 = WA_KONV_THC-KWERT.

               WA_FINAL-NON_TAX = WA_KONV_THC-KWERT.

*      gs_invoice-total = WA_KONV-kwert.

             ELSE.                          "FOR TER handling CHARGES - ZTH1 and 1ZTH

               WA_FINAL-TAX = WA_FINAL-TAX + WA_KONV_THC-KWERT.

               WA_FINAL-ZTH0 = WA_FINAL-ZTH0 + WA_KONV_THC-KWERT.

 

              READTABLE IT_KONV INTO WA_KONV_ZSR1       "added by Sonam Singh on dated 19th july'12 (zsr1,zec1,zsh1)

               WITHKEY KNUMV = WA_VBAK-KNUMV

                        KPOSN = WA_VBAK-POSNR

                        KSCHL = 'ZSR1'BINARYSEARCH.

 

                WA_FINAL-ZSR1 = WA_KONV_ZSR1-KWERT.

 

 

           READTABLE IT_KONV INTO WA_KONV_ZEC1

               WITHKEY KNUMV = WA_VBAK-KNUMV

                        KPOSN = WA_VBAK-POSNR

                        KSCHL = 'ZEC1'BINARYSEARCH.

 

              WA_FINAL-ZEC1 = WA_KONV_ZEC1-KWERT.

 

               READTABLE IT_KONV INTO WA_KONV_ZSH1

               WITHKEY KNUMV = WA_VBAK-KNUMV

                        KPOSN = WA_VBAK-POSNR

                        KSCHL = 'ZSH1'BINARYSEARCH.

 

              WA_FINAL-ZSH1 = WA_KONV_ZSH1-KWERT.

 

             ENDIF.

 

           ENDLOOP.

 

*Abate = Discounted Total - Ser.Tax basis Reven

           WA_FINAL-ABATE = WA_FINAL-ZFR0

                             - WA_FINAL-TAX .  "WA_KONV_ZSTB-KWERT (CHANGED FOR TAX)      .

*Service taxes ,ECS and SHE taxes...

 

           READTABLE IT_KONV INTO WA_KONV_ZSRT

               WITHKEY KNUMV = WA_VBAK-KNUMV

                        KPOSN = WA_VBAK-POSNR

                        KSCHL = 'ZSRT'BINARYSEARCH.

 

           WA_FINAL-ZSRT =   WA_FINAL-ZSR1 + WA_KONV_ZSRT-KWERT.     "added by Sonam Singh on dated 19th july'12

 

 

           READTABLE IT_KONV INTO WA_KONV_ZECS

               WITHKEY KNUMV = WA_VBAK-KNUMV

                        KPOSN = WA_VBAK-POSNR

                        KSCHL = 'ZECS'BINARYSEARCH.

 

           WA_FINAL-ZECS =  WA_FINAL-ZEC1 + WA_KONV_ZECS-KWERT.

 

           READTABLE IT_KONV INTO WA_KONV_ZSHE

               WITHKEY KNUMV = WA_VBAK-KNUMV

                        KPOSN = WA_VBAK-POSNR

                        KSCHL = 'ZSHE'BINARYSEARCH.

 

           WA_FINAL-ZSHE = WA_FINAL-ZSH1  + WA_KONV_ZSHE-KWERT.

 

 

 

           CLEAR: WA_KONV,WA_KONV_THC,WA_KONV_ZD01,WA_KONV_ZD02,WA_KONV_ZSTB,WA_KONV_ZSRT,WA_KONV_ZECS,WA_KONV_ZSHE.

 

           "Loop for every Billing Condition Number and

 

 

           IF WA_lips-MTART = 'C20'.                  "changes by Sonam

             L_TEU = 1.

           ELSEIF WA_lips-MTART = 'C40'OR WA_lips-MTART = 'CPK' .

             L_TEU = 2.

           else.

             clear l_teu.

           ENDIF.

 

           LV_PRODH = WA_VBRP-PRODH+5(5).

           CASE LV_PRODH.

             WHEN'00001'"REEFER

               WA_FINAL-CONTNER_TY = 'REEFER'.

             WHEN'00002'"DRY

               WA_FINAL-CONTNER_TY = 'DRY'.

             WHEN'00003'. "TANK

               WA_FINAL-CONTNER_TY = 'TANK'.

             WHEN'00004'. "OTHERS

               WA_FINAL-CONTNER_TY = 'OTHERS'.

           ENDCASE.

           wa_final-tpbez = wa_vttk-tpbez.

           WA_FINAL-VBELN = WA_VBRP-VBELN.

           WA_FINAL-AUBEL = WA_VBAK-VBELN."WA_VBRP-AUBEL.

           WA_FINAL-VGBEL = WA_LIPS-VBELN."WA_VBRP-VGBEL.

           WA_FINAL-AESKD = WA_LIPS-AESKD.

           WA_FINAL-NETWR = WA_FINAL-ZSRT + WA_FINAL-ZECS +

                             WA_FINAL-ZSHE + WA_FINAL-ZFR0 +

                             WA_FINAL-ZTH0.                                               "WA_VBRP-NETWR .

 

           WA_FINAL-NTGEW = WA_VBRP-NTGEW .

           WA_FINAL-BRGEW = WA_VBRP-BRGEW .

           WA_FINAL-MVGR1 = WA_VBRP-MVGR1 .

 

            if wa_lips-mtart = 'C00'.           "changes by Sonam

           WA_FINAL-MATNR = 'FLAT WAGON'.

           else.

           WA_FINAL-MATNR = WA_lips-MATNR .

           endif.

 

           WA_FINAL-MTART = WA_lips-MTART .

           WA_FINAL-TDLNR = WA_VTTK-TDLNR.

           WA_FINAL-TKNUM = WA_VTTK-TKNUM.

           WA_FINAL-ROUTE = WA_VTTK-ROUTE.

           WA_FINAL-KNANF = WA_ROUTE-KNANF.

           WA_FINAL-KNEND = WA_ROUTE-KNEND.

           WA_FINAL-SIGNI = WA_VTTK-SIGNI.

           WA_FINAL-BSTNK_VF = WA_VBRk-BSTNK_VF.    "changes by Sonam

           WA_FINAL-KUNNR = WA_KUNNR-KUNNR.

           WA_FINAL-NAME1 = WA_KNA1-NAME1.

           WA_FINAL-KUNNR_SL = WA_KUNNR1-KUNNR.

           WA_FINAL-NAME_SL = WA_SL-NAME1.

           WA_FINAL-CONSIN = WA_LINE-TDLINE.

           WA_FINAL-DATBG = WA_VTTK-DATBG.

           WA_FINAL-DATEN = WA_VTTK-DATEN.

           WA_FINAL-TEU = L_TEU.

           APPEND WA_FINAL TO IT_FINAL.

           CLEAR: WA_LINE-TDLINE.

           CLEAR: WA_LIPS, WA_VBRP, WA_VBRK, WA_VBAK, WA_KUNNR,WA_FINAL, WA_KNA1, WA_ROUTE, L_TEU,WA_KONV.   "WA_MARA.

*        ENDIF.

 

       ENDLOOP.

     ENDLOOP.

 

 

   ENDLOOP.

 

 

ENDFORM.                    " FETCH_DATA


Problem in selection-screen(when saving data)

$
0
0

Hi Expert,

 

 

 

I have a selection screen. i want to save data in ztable by clicking save. But when i click on save a Variant Attributes screen appear. But i want when i click on save then data save in ztable. please guide me expert ???

Add Search Help tab in IE03/02

$
0
0


Hi Expert,

 

I want to add a new  tab in IE02/03 Search help.which have input like Serial no,Material no and Customer no and output is Equipment no.

So how can i do it and which exit i have to use for this.i have create one function module which is giving me this reault but how to add/use this Funcion module to Search help.

 

Thanks,

Mahipalsinh.

Abnormal behavior of READ_TEXT for PO text in ME23N

$
0
0

Hi SAP Gurus,

 

I am facing the following issue in reading PO text from ME23N.

I am using function module READ_TEXT to read the text.

For the first time the function module is not reading the text.

If I edit the text and save, Then the function module is working.


Screen Shots given below.




 


Regards,

Pavan.

how to create a tree structure output screen to user,By clicking on each level of the tree, the lower level data can be seen, and by doble clicking the details have to come

$
0
0

TABLES : ekes, vepo, vekp.

 

TYPES : BEGIN OF ivekp,

        venum TYPE vekp-venum,

        exidv2 TYPE vekp-exidv2,

  END OF ivekp,

 

  BEGIN OF ivepo,

    vbeln TYPE vepo-vbeln,

    venum TYPE vepo-venum,

    END OF ivepo,

 

    BEGIN OF iekes,

      ebeln TYPE ekes-ebeln,

      vbeln TYPE ekes-vbeln,

      vbelp TYPE ekes-vbelp,

      xblnr TYPE ekes-xblnr,

      END OF iekes.

 

DATA : i_node TYPE TABLE OF snodetext,

       i_vekp TYPE TABLE OF ivekp,

       i_vepo TYPE TABLE OF ivepo,

       i_ekes TYPE TABLE OF iekes.

 

DATA : f_node TYPE snodetext,

       f_vekp TYPE ivekp,

       f_vepo TYPE ivepo,

       f_ekes TYPE iekes.

 

SELECT-OPTIONS :s_ebeln FOR ekes-ebeln.

 

START-OF-SELECTION.

 

  PERFORM get_ekes.

  PERFORM get_vepo.

  PERFORM get_vekp.

  PERFORM build_tree.

 

END-OF-SELECTION.

 

  PERFORM display_tree.

 

 

 

*&---------------------------------------------------------------------*

*&      Form  get_vepo

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

FORM get_vepo.

 

  SELECT venum

         vbeln

    FROM vepo INTO TABLE i_vepo

    FOR ALL ENTRIES IN i_ekes

    WHERE vbeln EQ i_ekes-vbeln.

ENDFORM.                    "get_vepo

 

 

*&---------------------------------------------------------------------*

*&      Form  get_vekp

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

FORM get_vekp.

 

  SELECT venum

         exidv2

    FROM vekp INTO TABLE i_vekp

    FOR ALL ENTRIES IN i_vepo

    WHERE venum EQ i_vepo-venum.

ENDFORM.                    "get_vekp

 

 

 

*&---------------------------------------------------------------------*

*&      Form  get_ekes

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

FORM get_ekes.

 

  SELECT ebeln

         vbeln

         vbelp

         xblnr

    FROM ekes INTO TABLE i_ekes

    WHERE ebeln IN s_ebeln.

ENDFORM.                    "get_ekes

*&---------------------------------------------------------------------*

*&      Form

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

 

*&---------------------------------------------------------------------*

*&      Form  build_tree

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

FORM build_tree.

 

  CLEAR : i_node, f_node.

 

  f_node-type = 'T'.

  f_node-name = 'Purchase Order'(002).

  f_node-tlevel = '01'.

  f_node-nlength = '20'.

  f_node-color = '5'.

  APPEND f_node TO i_node.

  CLEAR f_node.

 

 

  LOOP AT i_ekes INTO f_ekes.

 

 

    f_node-type = 'P'.

    f_node-tlevel = '02'.

    f_node-text1 = f_ekes-ebeln.

    f_node-tlength1 = '20'.

    f_node-tcolor1 = '3'.

    f_node-text2 = f_ekes-vbeln.

    f_node-tlength2 = '20'.

    f_node-tcolor2 = '3'.

    f_node-text3 = f_ekes-vbelp.

    f_node-tlength3 = '20'.

    f_node-tcolor3 = '3'.

    f_node-text4 = f_ekes-xblnr.

    f_node-tlength4 = '20'.

    f_node-tcolor4 = '3'.

    APPEND f_node TO i_node.

    CLEAR f_node.

 

    LOOP AT i_vepo INTO f_vepo WHERE vbeln EQ f_ekes-vbeln.

 

      f_node-type = 'P'.

      f_node-tlevel = '03'.

      f_node-text = f_vepo-vbeln.

      f_node-tlength = '20'.

      f_node-tcolor = '4'.

      f_node-text6 = f_vepo-venum.

      f_node-tlength6 = '20'.

      f_node-tcolor6 = '4'.

      APPEND f_node TO i_node.

      CLEAR f_node.

 

    ENDLOOP.

 

    LOOP AT i_vekp INTO f_vekp WHERE venum EQ f_vekp-venum.

 

      f_node-type = 'P'.

      f_node-tlevel = '04'.

      f_node-text = f_vekp-venum.

      f_node-tlength = '20'.

      f_node-tcolor = '5'.

      f_node-text6 = f_vekp-exidv2.

      f_node-tlength6 = '20'.

      f_node-tcolor6 = '5'.

      APPEND f_node TO i_node.

      CLEAR f_node.

 

    ENDLOOP.

  ENDLOOP.

 

ENDFORM.                    "build_tree

 

*&---------------------------------------------------------------------*

*&      Form  display_tree

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

FORM display_tree.

  CALL FUNCTION 'RS_TREE_CONSTRUCT'

    TABLES

      nodetab            = i_node

    EXCEPTIONS

      tree_failure       = 1

      id_not_found       = 2

      wrong_relationship = 3

      OTHERS             = 4.

  IF sy-subrc <> 0.

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

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

  ENDIF.

  CALL FUNCTION 'RS_TREE_LIST_DISPLAY'

    EXPORTING

      callback_program = sy-repid.

 

ENDFORM.        

BAPI_ACC_DOCUMENT_POST error while posting for group currency FBB1.

$
0
0

Hi All

 

We are trying to post a document against different GL accounts via BAPI_ACC_DOCUMENT_POST for group currency.

But it is throwing an error 'Balance in transaction currency'. I am assuming that the credit - debit is not coming out to be ZERO. This requirement is for Hyperinflation in Venezuela.

 

I am doing it in USD as well as the local currency VEF. Below are the values I am passing in the structure CURRENCYAMOUNT.

 

credit:

wa_curramt-itemno_acc = '0001'.

wa_curramt-curr_type = '10'.

wa_curramt-curr = 'VEF'.

wa_curramt-amt_doccur = '68.4'.

APPEND wa_curramt TO ta_curramt.

CLEAR wa_curramt.

 

credit:

wa_curramt-itemno_acc = '0001'.

wa_curramt-curr_type = '30'.

wa_curramt-curr = 'USD'.

wa_curramt-amt_doccur = '10'.

APPEND wa_curramt TO ta_curramt.

CLEAR wa_curramt.

 

credit:

wa_curramt-itemno_acc = '0002'.

wa_curramt-curr_type = '10'.

wa_curramt-curr = 'VEF'.

wa_curramt-amt_doccur = '68.4'.

APPEND wa_curramt TO ta_curramt.

CLEAR wa_curramt.

 

credit:

wa_curramt-itemno_acc = '0002'.

wa_curramt-curr_type = '30'.

wa_curramt-curr = 'USD'.

wa_curramt-amt_doccur = '10'.

APPEND wa_curramt TO ta_curramt.

CLEAR wa_curramt.

 

debit:

wa_curramt-itemno_acc = '0003'.

wa_curramt-curr_type = '10'.

wa_curramt-curr = 'VEF'.

wa_curramt-amt_doccur = '136.8'.

APPEND wa_curramt TO ta_curramt.

CLEAR wa_curramt.

 

debit:

wa_curramt-itemno_acc = '0003'.

wa_curramt-curr_type = '30'.

wa_curramt-curr = 'USD'.

wa_curramt-amt_doccur = '20'.

APPEND wa_curramt TO ta_curramt.

CLEAR wa_curramt.

 

Let me know if some more info is needed from my end.

 

Thanks in advance,

Tejaswini

REUSE_ALV_FIELDCATALOG_MERGE doesn't populate fieldcatalog

$
0
0


Hello,

I am strugling with a report. I use the REUSE_ALV_FIELDCATALOG_MERGE quite often, and it never caused any troubles until now. I basically copy pasted the alv functionality from another report, however this time it doesnt work. Maybe some of you can look at it and identify the obvious mistake I cant see. I cannot find any solution in other topics.

 

Here is a code abstract (report is made in 72characters lines):


...
type-pools: slis.
...

 

*/ final internal table definition

 

TYPES:

      begin of POMTAB,

      BSART like EKKO-BSART,

      EBELN like EKKO-EBELN,

      EBELP like EKPO-EBELP,

      LIFNR like EKKO-LIFNR,

      FRGKE like EKKO-FRGKE,

      FRGZU like EKKO-FRGZU,

      FRGSX like EKKO-FRGSX,

       LUSER like EBAN-AFNAM,

       LADAT like EBAN-BEDAT,

       AUSER like EBAN-AFNAM,

       HUSER like EBAN-AFNAM,

      ERNAM like EKKO-ERNAM,

      AEDAT like EKKO-AEDAT,

      WERKS like EKPO-WERKS,

      BEDNR like EKPO-BEDNR,

      MATNR like EKPO-MATNR,

      TXZ01 like EKPO-TXZ01,

      MENGE like EKPO-MENGE,

      MEINS like EKPO-MEINS,

      NETPR like EKPO-NETPR,

      PEINH like EKPO-PEINH,

      NETWR like EKPO-NETWR,

      KNTTP like EKPO-KNTTP,

      KOSTL like EKKN-KOSTL,

      AUFNR like EKKN-AUFNR,

      line_color(4) type c,     "Used to store row color attribute

      end of POMTAB.

DATA: I type POMTAB,

      ITAB type standard table of POMTAB with header line.

 

*/ the code follows...

 

data: fieldcatalog type slis_t_fieldcat_alv with header line,

      gd_tab_group type slis_t_sp_group_alv,

      gd_layout    type slis_layout_alv,

      gd_repid     like sy-repid.

DATA: c_user_command TYPE slis_formname VALUE 'USER_COMMAND'.

...

*/ selection is made and the final internal table is filled, so I try to build the ALV

 

 

  perform build_fieldcatalog.

  perform build_layout.

  perform display_alv_report.

 

 

 

form build_fieldcatalog.

DATA: w_repid type sy-repid.

  move sy-repid to w_repid.

*/ I tried to pass the sy-repid directly to the function, no success

 

 

*&---------------------------------------------------------------------*

*&      Form  BUILD_FIELDCATALOG

*&---------------------------------------------------------------------*

*       Build Fieldcatalog for ALV Report

*----------------------------------------------------------------------*

form build_fieldcatalog.

DATA: w_repid type sy-repid.

  move sy-repid to w_repid.

  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

    EXPORTING

      i_program_name          = w_repid

      i_internal_tabname      = 'ITAB'

      i_inclname              = w_repid

      i_bypassing_buffer      = 'X'

    CHANGING

      ct_fieldcat             = fieldcatalog[]

    EXCEPTIONS

      inconstistent_interface = 1

      program_error           = 2

      other                   = 3.

  if sy-subrc <> 0.

    message id sy-msgid type sy-msgty number sy-msgno with sy-msgv1

    sy-msgv2 sy-msgv3 sy-msgv4.

  ENDIF.

*/..and got no fieldcatalog

 

 

 

Any help appreciated.

Thank you.

F-02 Profit center value is not updated in BSID table

$
0
0

Dear All

 

I creaetd one Incoming payment (Customer) entry through F-02

 

I provided profit center value while entering the Bank Ledger Code.  For Customer Entry ( it does not ask profit center).

The entry is okay.

 

But, when I see the table BSID for that customer,  the profit center field is not updated.  However, in BSIS table the profit center is updated for bank entry.

 

This result, in F-28, the profit center field is displaying as blank.

 

How to make the system to update both entry with profit center value.

 

We are using New GL.

 

PS:  is there any configuation available  or any exit where I can updaet the BSID table as well.

 

Regards

Venkat


FIDCCP02 Tax line

$
0
0

Hi, I am trying to use the above IDOC to post a invocie with Tax.  I am populating the following:

 

1) E1FIKPF with Header Information

2) E1FISEG - 2lines ( 1 for credit anf 1 for debit)

3) E1FISET segment with the net and tax amounts

 

but tax amount is not posting, can any body suggest

Launch chain after file upload

$
0
0

Hi experts,

 

I am using a program to upload csv files into al11 server.

 

I would like to launch a BW process chain automatically each time a new file version is uploaded to the al11 server.

 

I thought about creating an event to manage my case. But how can I know that a new file version was uploaded.

 

I mean do I have to create a program which reads the date/Hour modification regularly (each hour/day)?

 

Are they any better options?

 

Thanks.

 

Amine

Error while appending zstructure into BSEG Table

$
0
0

We had appended BSEG table with a ZSTRUCTURE to enable Custom field in MIRO. Subsequently there was a change required in the appended field. After Changing the field there was adjustment required to activate the appended table . However due to slow system performance during that time the Adjustment SE14 timed out. And created inconsistency in BSEG table.

 

If I Do the Table adjustment now it is showing error.

 

We tried to delete the append structure also but the structure is not appearing in the append structure list to delete.


Even if we try deleting the Z structure from se11 it is throwing  error.


Please do the needful .

string read for diffrent scenario

$
0
0

Hi experts,

 

in in internal table

 

entries are like this

 

/dirname/filrname1/1011/a.text

/dirname/filrname1/1012/b.text

/dirname/filrname1/1013/c.text

 

 

/dirname/filrname2/1011/a.text

/dirname/filrname2/1012/b.text

/dirname/filrname2/1013/c.text

 

/dirname/filrname3/1011/a.text

/dirname/filrname3/1012/b.text

/dirname/filrname3/1013/c.text

 

 

i want to replace last stringt values eg 1011/a.text with TEMP.

 

output]

 

 

/dirname/filrname1/TEMP

/dirname/filrname1/temp

/dirname/filrname1/temp

 

/dirname/filrname2/temp

/dirname/filrname2/temp

/dirname/filrname2/temp

/dirname/filrname3/temp

/dirname/filrname3/temp

/dirname/filrname3/temp

 

can u suggest me any way to do this

Save button is missing for the prog RMMD06NEW

$
0
0

Hi,

I've copied the program RMMD06NEW and RMMD07NEW as z programs. in the output of the report RMMD07NEW has 'Save button' but RMMD06NEW it doesn't have. Is it configuration issue or any settings change or we nee to add the save button.

 

Regards,

Vallamuthu Madheswaran

CNTL_ERROR while running a custom report program in background mode

$
0
0

Hi,

I am running a report in background on daily basis. I am using cl_gui_custom_container class here and calling the constructor of this class. I am getting a CNTL_ERROR exception at this point. But if i run the same report directly, it is not throwing any exception. The problem is if i schedule it to background. I am not able to sort it out.

I've written the following code below:

 

I did apply the logic that you'd mentioned.

I've implemented the code as below.

 

IF  gr_container IS INITIAL.

*** Check whether the program is run in batch or foreground

   
IF CL_GUI_ALV_GRID=>OFFLINE( ) IS INITIAL.

* Run in foreground

     
CREATE OBJECT gr_container

       
EXPORTING

          container_name
= 'WORK_AREA_CONTAINER'.

     
CREATE OBJECT lv_grid

       
EXPORTING I_PARENT = gr_container.

   
ELSE.

* Run in background

     
CREATE OBJECT lv_grid

       
EXPORTING

          I_PARENT
= gr_dockcontainer.

     
ENDIF.

     
ENDIF.

 

 

 

i_parent_control = gr_dockcontainer.



       
CREATE OBJECT m_base_splitter

       
EXPORTING

          parent           
= i_parent_control

         
ROWS              = 1

          columns          
= 2

       
EXCEPTIONS

          cntl_error       
= 1

          cntl_system_error
= 2

         
OTHERS            = 3.



       
CALL METHOD m_base_splitter->get_container

       
EXPORTING

          row      
= 1

          column   
= 2

          RECEIVING

          container
= m_splitter_right_part

       
EXCEPTIONS

         
OTHERS    = 1.

 

 

After I've implemented the above code I'm getting the following error in the batch job:

 

Category               ABAP Programming Error

Runtime Errors         OBJECTS_OBJREF_NOT_ASSIGNED

Except.                CX_SY_REF_IS_INITIAL

 

You attempted to use a 'NULL' object reference (points to 'nothing')

access a component (variable: "M_BASE_SPLITTER").

An object reference must point to an object (an instance of a class)

before it can be used to access components.

Either the reference was never set or it was set to 'NULL' using the

CLEAR statement.

 

Would you be able to help me in the above issue?

 

Regards,

Mandeep

Using FM TEXT_CONVERT_XLS_TO_SAP for uploading excel file having fields with more than 256 characters?

$
0
0

Hi Experts,

 

I need to upload an excel file(.xlsx) with 14 columns. One of the fields of the sheet has more than 256 characters hence I cannot use FM TEXT_CONVERT_XLS_TO_SAP(as max length is 256 characters ).

After I execute the FM in my report the field having values more than 256 characters get truncated to 256 chars.

I have attached the image of excel file upload.jpeg which has two fields namely "description" and 'action history" that have length greater than 256.

 

Plz Advice and Help.

 

 

Regards,

Shubharaj.


bapi_material_savedata

$
0
0


i want  waht values you have filled in maramx..

How To UPLOAD a DATA (.DAT) fiel from PC to internal table and then split it into the data different columns

$
0
0

Hi all,

I am new to ABAP Development. I need to upload a .DAT file (the file doesn#t have any proper structure-- Please find the .DAT file in the attachment). After uploading the DATA (.DAT) fiel I need to split in into different columns. Refering the attached .DAT fiel the fields in bracets like:

[Arbeitstag],  [Pecunia], [Mita], [Kunde], [Auftrag] and  [Position] are different fields that need to be arranged in columns in an internal table. this .DAT fiel which I want to upload and then SPLIT it into various fields will will treated as MASTER DATA table for further programming. The program that I had written is as below. Also please refer the attached .DAT table.

 

Please if any one could help me. i searched a lot in different forums but couldn't find me  a solution. Also note that the attached fiel is in text (.txt) format here but in real situation the same fiel is in DATA (.DAT) format.

 

*&---------------------------------------------------------------------*

*& Report  ZDEMO_ZEITERFASSUNG9

*&

*&---------------------------------------------------------------------*

*&

*&

*&---------------------------------------------------------------------*

 

 

REPORT  ZDEMO_ZEITERFASSUNG9.

 

Types: Begin of ttab,

        Rec(1000) type c,

       End of ttab.

 

DATA: itab  type table of ttab.

DATA: wa_tab type ttab.

DATA: file_str type string.

 

Parameters: p_file type localfile.


At selection-screen on value-request for p_file.

                                       CALL FUNCTION 'KD_GET_FILENAME_ON_F4'

                                        EXPORTING

*                                          PROGRAM_NAME        = SYST-REPID

*                                          DYNPRO_NUMBER       = SYST-DYNNR

*                                          FIELD_NAME          = ' '

                                           STATIC              = 'X'

*                                          MASK                = ' '

                                         CHANGING

                                           file_name           = p_file.

*                                        EXCEPTIONS

*                                          MASK_TOO_LONG       = 1

*                                          OTHERS              = 2

                                                 .

 

Start-of-Selection.

  file_str = P_file.

 

  CALL FUNCTION 'GUI_UPLOAD'

    EXPORTING

      filename                      = '\\10.10.1.92\Volume_1\_projekte\Zeiterfassung-SAP\BUP_ZEIT.DAT'   " This the file  source address

      FILETYPE                      = 'DAT'

      HAS_FIELD_SEPARATOR           = ';'

*     HEADER_LENGTH                 = 0

*     READ_BY_LINE                  = 'X'

*     DAT_MODE                      = ' '

*     CODEPAGE                      = ' '

*     IGNORE_CERR                   = ABAP_TRUE

*     REPLACEMENT                   = '#'

*     CHECK_BOM                     = ' '

*     VIRUS_SCAN_PROFILE            =

*     NO_AUTH_CHECK                 = ' '

*   IMPORTING

*     FILELENGTH                    =

*     HEADER                        =

    tables

      data_tab                      = itab

   EXCEPTIONS

     FILE_OPEN_ERROR               = 1

     FILE_READ_ERROR               = 2

     NO_BATCH                      = 3

     GUI_REFUSE_FILETRANSFER       = 4

     INVALID_TYPE                  = 5

     NO_AUTHORITY                  = 6

     UNKNOWN_ERROR                 = 7

     BAD_DATA_FORMAT               = 8

     HEADER_NOT_ALLOWED            = 9

     SEPARATOR_NOT_ALLOWED         = 10

     HEADER_TOO_LONG               = 11

     UNKNOWN_DP_ERROR              = 12

     ACCESS_DENIED                 = 13

     DP_OUT_OF_MEMORY              = 14

     DISK_FULL                     = 15

     DP_TIMEOUT                    = 16

     OTHERS                        = 17

 

            .

  IF sy-subrc <> 0.

* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

  ENDIF.

 

  LOOP at itab into wa_tab.

     

        WRITE: / wa_tab.

 

  ENDLOOP.

 

I will be grateful to all you experts for ur inputs

regards

Chandan Singh

Running background reports with internal table parameters.

$
0
0

Hello Friends,

 

I have a query. The scenario is that I want to process a large database table, say a BUT000 table and want to change some non-key field values.

A simple approach would be to

-execute a SELECT statement and retrieve the records in an internal table.

-change the values in the internal table.

- then update the database table from the internal table.

 

However, for large tables, performance issue will occur and the program might timeout.

 

So one solution would be to run a report in batches in background, each report processing 100 entries of the table.

 

The algorithm would be somewhat like this (Please ignore syntax):

OPEN CURSOR c1 FOR SELECT * FROM <db_table>

DO till all the records are processed.

         FETCH 100 records INTO lt_tab[ ].

               SUBMIT change_report WITH lt_tab[ ] IN BACKGROUND mode.

ENDDO.

 

  1. One way to achieve this is to use the EXPORT/IMPORT MEMORY of ABAP. However for this to work, all these SUBMITted reports need to be executed in the same work process. But we know that REPORTs in BACKGROUND job will work on different work processes. So this is not the solution.
  2. Another way is to use EXPORT/IMPORT to SHARED MEMORY or SHARED BUFFER. However, this will store the internal tables in the application buffer of the aplication server. So in this case, all the background reports need to be executed in the same application server so that they have access to the shared memory.
  3. One more solution is to EXPORT/IMORT the data to DATABASE cluster tables like INDX cluster table.

EXPORT itab FROM itab TO DATABASE indx(ar) CLIENT sy-mandt ID job_number

IMPORT itab TO itab FROM DATABASE indx(ar) CLIENT sy-mandt ID job_number

However, I am not sure if this will work cross-application-servers. My guess is this solution should hold even if the background reports are run in different application servers of the system.

 

Could anyone guide me as to whether my understanding of the above 3 points is correct?  Any comments on Point 3 ?

Are there any more solutions to this scenario?

 

With Kind regards,

Sameer.

"You no change authorization" - SV349

$
0
0

Hello!

 

I need to adjust the maintanance dialog to view:  J_1BECD_CUST03V but i receive the message: "You no change authorization" - SV349.

 

I tried TCOD SE54 and TCOD SE11.

 

Guess it's not a security/authorizarion problem the developer user has SAP_ALL.

 

Can anyone help?

 

Thanks!

reg:'BAPI_MATERIAL_SAVEDATA'

$
0
0

Hi ,,

 

I am creating the Material Using 'BAPI_MATERIAL_SAVEDATA'

 

I am getting error 'Specify the conversion factors for the unit of measure EA

how to solve it this issue its very urjent can anybody help me plse..'

Viewing all 8332 articles
Browse latest View live


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