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

Downloading Status Messages into Excel/Access

$
0
0

Hi there,

 

I am new to this board, so not sure if I am at the correct spot.

 

We use the free SAP Addin GUIXT to create PSP-Elements from Excel/Access Files.

When a PSP-Element has been created successfully, the status bar at the bottom of the screen says "PSP-Element XYZ has been created".

 

We would like to show this message in the Excel file, from which the creation process had been initiated. Is this possible somehow?

E.G. by downloading all messages from a SAP table with a transaction somehow, or exporting the message?

 

Any help is welcome.

Thanks an merry christmas.


Multiple Custom Segments of IDOC missing

$
0
0

Hi,

 

 

Scenario 1: Single Segment and Single Values. Working Fine.

C1.JPG

Scenario 2: Second Segment and Multiple Line Items. Second Line Item Value/Segment is Missing.

C2.JPG

Missing ZSegment

Idoc ID1.JPG

Kindly let me know how to get the above missing Zsegment with its respective field.

Where should i change my code.

 

With Regards,

Sudhir.

PDF - container variables in a script

$
0
0

Hello.

 

Please tell me how I can refer to the variable container PDF if they are not on the screen.

 

For Example:

 

I imported from the interface in the container table IT_TAB with fields:

FIELD01

FIELD02

FIELD03

COLOR_LINE


In the form of PDF displays a table IT_TAB with fields:

FIELD01

FIELD02

FIELD03


That is a technical field COLOR_LINE.


For example I want to change the color of rows in the table, depending on the value of the field COLOR_LINE. I write the following script:


data.#subform[1].IT_TAB.DATA::ready:layout - (JavaScript, client)


DATA.fillColor = DATA.COLOR_LINE;


But the variable is not defined COLOR_LINE. How can I get the value from the field COLOR_LINE?

MARD and MCHB table join for stock display

$
0
0

Dear Experts,

 

I've a requirement to develop a report which generates the output with the freestock for which i've joining th 2 tables of MCHB and MARD  with the key field is matnr. .

 

If i pass the material into the selection screen the material stock present in MCHB is only flowing and the material which is in MARD is not flowing.

Need help . It's urgent requirement

 

Piece of coding is as below.

 

LOOP AT GT_MCHB INTO GS_MCHB.
     GS_FINAL-MATNR = GS_MCHB-MATNR.
     GS_FINAL-WERKS = GS_MCHB-WERKS.
     GS_FINAL-LGORT = GS_MCHB-LGORT.
     GS_FINAL-CHARG = GS_MCHB-CHARG.
     GS_FINAL-J_3ASIZE = GS_MCHB-J_3ASIZE.
     GS_FINAL-CLABS = GS_MCHB-CLABS.

  READ TABLE GT_MAKT INTO GS_MAKT WITH KEY MATNR = GS_MCHB-MATNR.
  GS_FINAL-MAKTX = GS_MAKT-MAKTX.

READ TABLE GT_MARD INTO GS_MARD WITH KEY MATNR = GS_MAKT-MATNR.
GS_FINAL-MATNR = GS_MARD-MATNR.


  APPEND GS_FINAL TO GT_FINAL.


Best rgds/thnks,

Srikanth.




ALV container problem in pop up screen

$
0
0

Hell all,

 

I have a program which have several screens and pop ups.

For example : I start with 100 screen and call 200 screen than 300 scren and then  return to 100 screen but container just disappear in 100 screen.

I cant see alv or container at all.

This is the code that i use at the PBO of 100 screen.

I use custom container and some input fields in this screen.

 

  gs_layout100-no_toolbar = 'X'.

   gs_layout100-cwidth_opt = 'X'.

 

   CREATE OBJECT go_cont100

     EXPORTING

       parent         = cl_gui_container=>screen2

       container_name = 'CC100'.

 

   CREATE OBJECT go_grid100

     EXPORTING

       i_parent = go_cont100.

 

   CALL METHOD go_grid100->set_table_for_first_display

     EXPORTING

       is_layout       = gs_layout100

     CHANGING

       it_fieldcatalog = gt_fcat100[]

       it_outtab       = gt100[].

SD Billing VF02-VF03 Plant Authority

$
0
0

Hi Experts,

 

I want to add authority according Plant at SD billing process. (VF01-VF02-VF03-VFX3)

I found and add for VF01. (USEREXIT_FILL_VBRK_VBRP (Module pool SAPLV60A, program RV60AFZC)

 

 

But I didnt found for VF02-03.

 

I want to add authority object at filling/Show time.

 

Do you know any userexit, badi etc. for VF02-03 transaction. 

 

Best regards.


CX_SY_DYNAMIC_OSQL_SYNTAX abap Z report

$
0
0

Hi Team,

 

I have tried to use a dynamic select query in my z abap program. Here i am getting

CX_SY_DYNAMIC_OSQL_SYNTAX error. Its because in my dynamic select query a apactupe( ' ) is coming as a field content in where condition.

As a result the query is resulting into error.

 

Requesting you to please advice how to eliminate this issue

.

Thanks in advance for your time

How to restrict Standard/Custom Segment triggering from Multiple Times

$
0
0

Hi,

 

Find the piece of code below as per my requirement regarding adding Idoc Zsegments and fields.

Its working fine.

 

*Getting the Delivery Document Number and assigning it to the Where Clause

FIELD-SYMBOLS: <FS_EDIDD> TYPE EDIDD.

READ TABLE IDOC_DATA ASSIGNING <FS_EDIDD> WITH KEY SEGNAM = 'E1EDL20'.

IF <FS_EDIDD> IS ASSIGNED.

   LS_E1EDL20 = <FS_EDIDD>-SDATA.      "Delivery Document Number

ENDIF.

 

*1*Fetching the respective fields for IDoc: Delivery header

SELECT SINGLE VBELN LIFNR ZZASNNO ZZINVOIVE_NO ZZREASON FROM LIKP INTO LS_LIKP WHERE VBELN = LS_E1EDL20-VBELN.

CHECK SY-SUBRC = 0.

*1****************************************Delivery header******************************1

READ TABLE IDOC_DATA INTO ls_edidd WITH KEY segnam = 'E1EDL20'.   "Custom Segment Position

CHECK SY-SUBRC = 0.

lv_tabix = sy-tabix + 1.

CONCATENATE LS_LIKP-ZZASNNO+0(20) LS_LIKP-ZZINVOIVE_NO+0(10) LS_LIKP-ZZREASON+0(20) INTO lv_sdata1.

ls_edidd-sdata = lv_sdata1.

ls_edidd-segnam = co_E1EDL20.

INSERT ls_edidd INTO IDOC_DATA INDEX lv_tabix.

CHECK sy-subrc = 0.

CLEAR: LS_LIKP,

        lv_sdata1,

        ls_edidd.


Doubt: As Respective "Include -   zxtrku02" is triggering multiple times and so my "segment E1EDL20"/Zsegment ZE1EDL20.


How to restrict my standard segment E1EDL20 and its custom segment ZE1EDL20 from triggering mutiple times.

Kindly let me know ASAP.

 

Idoc Details:

Message Type: DESADV

Basic Type: DELVRY03

Outbound Process Code: DELV

Output Type: OPOD

Function Module - IDOC_OUTPUT_DELVRY

Customer Exit - customer-function '002'

FM Exit name - EXIT_SAPLV56K_002

Include -   zxtrku02

 

 

With Regards,

Sudhir.


What is use of protect ...endprotect command in script and smartform

$
0
0

Hi Experts,

 

I have a confuse to about of protect..end protect command in script and smart forms.Generally we know this command is using in script  and smart forms for page protection means if we want show 10 line in first page but there no enough space then using this command we can see complete 10 lines in next page.But today i tried with smart form i created a smart form with two page and in first page main window size i took 2 line capable and in second page window size i took 10 line capable and in first page i wrote 10 line paragraph and used page protection check box but while i executed i saw its generated 5 page and each page divided by 2 line. Can anyone clear my this doubt.

 

Thanks.

Shipment Header Screen

$
0
0

Hi Team,

 

  I have a requirement like add two new filed instead of driver 1 and driver 2 in the shipment header screen, Already  added the two new fields by providing the F4 option. However the selecting F4 value is disappearing after press the enter button on shipment header screen.

 

Could you please let me know how to achieve the above mentioned?

 

Regards,

SK.

i want to send an internal table with html mail.

$
0
0

hi,

i created a fm. and i want to give an internal table to imports value. then i want to send this internal table with html mail. but how can i give internal table to fm. because data type is unknown. it can changes. please help me.

problem in alv report ..

$
0
0

this is my classical report program ..

 

i made changes ...

 

after getting my output in alv when i am pressing f3 i am getting classical report display .

 

in the below program i am not getting some field in alv but in classical i am getting output like

 

1. debit   ---dmbtr

2.credit ---------- dmbtr                    but not taking in alv  unknown

3.running balance ---------wrbtr        but not taking in alv report  unknown

4. gl account ------------

5. debit credit indicator ----  shkzg

 

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

*& Report  ZST_FI_RPT_VEND_ACCT

*&

*& This report is for Vendor Account yearly

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

*   Dev. Class       : ZSTFI                                           *

*   Created by       : Vinod Nagre (vinod.nagre@birlasoft.com)         *

*   Created on       : 19.07.2007                                      *

*   Req.no:          : STDK900152                                      *

*   Transaction Code : ZRFI11                                          *

*   Module Name      : Financial Accounting                            *

*   Description      : Vendor Account yearly                           *

*   SAP Release      : SAP ECC 6.0                                     *

*   Change Request   : STDK900757                                      *

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

 

 

REPORT  zst_fi_rpt_vend_acct NO STANDARD PAGE HEADING

                             LINE-SIZE 236

*                             LINE-COUNT 60(2).

                              LINE-COUNT 80(2).

 

 

 

 

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

****                 TABLES DEFINITION                              ****

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

TABLES: bkpf,                   "Accounting Document Header

        bsis,                   "Accounting: Secondary Index for G/L Accounts

        bsas,                   "Accounting: Secondary Index for G/L Accounts (Cleared Items)

        ska1,                   "G/L Account Master (Chart of Accounts)

        t001,                   "Company Codes

        t003t,                  "Document Type Texts

        lfa1,                   "Vendor Master (General Section)

        skat,                   "G/L Account Master Record (Chart of Accounts: Description)

        bsik,                   "Accounting: Secondary Index for Vendors

        bsak,                   "Accounting: Secondary Index for Vendors (Cleared Items)

        bsad,                   "Accounting: Secondary Index for Customers (Cleared Items)

        bsid ,                  "Accounting: Secondary Index for Customers

        lfc1,                   "Vendor master (transaction figures)

        knc1,                   "Customer master (transaction figures)

        bseg.                   "Accounting Document Segment

 

 

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

****                 SELECTION-SCREEN                               ****

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

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

SELECT-OPTIONS:  s_bukrs FOR bsik-bukrs NO INTERVALS NO-EXTENSION,

                 s_budat FOR bsik-budat ,

                 s_lifnr FOR bsik-lifnr ,

                 s_gsber FOR bseg-gsber NO INTERVALS NO-EXTENSION ,

                 s_gjahr for bsik-gjahr OBLIGATORY.

*PARAMETERS: s_gjahr LIKE bsik-gjahr OBLIGATORY .

 

 

SELECTION-SCREEN: END OF BLOCK scr1.

 

 

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

****                 INTERNAL TABLES                                ****

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

 

 

 

 

DATA : BEGIN OF itab OCCURS 0,

       lifnr LIKE lfc1-lifnr,                  "Account Number of Vendor or Creditor

       bukrs LIKE lfc1-bukrs,                  "Company Code

       gjahr LIKE lfc1-gjahr,                  "Fiscal Year

       umsav LIKE lfc1-umsav,                  "Balance Carried Forward in Local Currency

       um01s LIKE lfc1-um01s,                  "Total of the Debit Postings for the Month

       um01h LIKE lfc1-um01h,                  "Total of the Credit Postings for the Month

       um01u LIKE lfc1-um01u,                  "Sales in the Posting Period

       END OF itab.

 

 

DATA : BEGIN OF itab1 OCCURS 0,

       bukrs LIKE bsik-bukrs,                  "Company Code

       lifnr LIKE bsik-lifnr,                  "Account Number of Vendor or Creditor

       umskz LIKE bsik-umskz,                  "Special G/L Indicator

       dmbtr LIKE bsik-dmbtr,                  "Amount in Local Currency

       dmbtr_d LIKE bsak-dmbtr,                "Amount in Local Currency

       dmbtr_c LIKE bsik-dmbtr,                "Amount in Local Currency

       shkzg   LIKE bsik-shkzg,                "Debit/Credit Indicator

       budat LIKE bsik-budat,                  "Posting Date in the Document

       gjahr LIKE bsik-gjahr,                  "Fiscal Year

       sgtxt LIKE bsik-sgtxt,                  "Item Text

       open_id,

       blart LIKE bsik-blart,                  "Document Type

       bldat LIKE bsik-bldat,                  "Document Date in Document

       belnr LIKE bsik-belnr,                  "Accounting Document Number

       zuonr LIKE bsas-zuonr,                  "Assignment Number

       buzei LIKE bsas-buzei,                  "Number of Line Item Within Accounting Document

       qbshb LIKE bseg-qbshb,                  "Withholding Tax Amount (in Document Currency)

       bschl LIKE bseg-bschl,                  "Posting Key

       gsber LIKE bseg-gsber,                  "Business Area

END OF itab1.

 

 

DATA : BEGIN OF itab2 OCCURS 0,

       lifnr LIKE bsak-lifnr,                  "Account Number of Vendor or Creditor

       umskz LIKE bsak-umskz,                  "Special G/L Indicator

       dmbtr LIKE bsak-dmbtr,                  "Amount in Local Currency

       dmbtr_d LIKE bsak-dmbtr,                "Amount in Local Currency

       dmbtr_c LIKE bsik-dmbtr,                "Amount in Local Currency

       shkzg   LIKE bsak-shkzg,                "Debit/Credit Indicator

       bldat   LIKE bsak-bldat,                "Document Date in Document

       budat   LIKE bsak-budat,                "Posting Date in the Document

       gjahr   LIKE bsak-gjahr,                "Fiscal Year

       gsber LIKE bsak-gsber,                  "Business Area

       END OF itab2.

 

 

DATA : BEGIN OF itab3 OCCURS 0,

       gjahr LIKE bsik-gjahr,                  "Fiscal Year

       bukrs LIKE bsik-bukrs,                  "Company Code

       lifnr LIKE bsik-lifnr,                  "Account Number of Vendor or Creditor

       kunnr LIKE bsid-kunnr,                  "Customer Number 1

       budat LIKE bsik-budat,                  "Posting Date in the Document

       gsber LIKE bsik-gsber,                  "Business Area

       umskz LIKE bsik-umskz,                  "Special G/L Indicator

       dmbtr LIKE bsik-dmbtr,                  "Amount in Local Currency

       dmbtr_d LIKE bsak-dmbtr,                "Amount in Local Currency

       dmbtr_c LIKE bsik-dmbtr,                "Amount in Local Currency

       totalx LIKE bsik-dmbtr,                 "Amount in Local Currency

       shkzg   LIKE bsik-shkzg,                "Debit/Credit Indicator

       bldat LIKE bsik-bldat,                  "Document Date in Document

       open_id,

       belnr LIKE bsik-belnr,                  "Accounting Document Number

       blart LIKE bsik-blart,                  "Document Type

       zuonr LIKE bsas-zuonr,                  "Assignment Number

       buzei LIKE bsas-buzei,                  "Number of Line Item Within Accounting Document

       sgtxt LIKE bsik-sgtxt,                  "Item Text

       qbshb LIKE bseg-qbshb,                  "Item Text

       bschl LIKE bseg-bschl,                  "Posting Key

       butxt LIKE t001-butxt,                  "Name of Company Code or Company

       hkont LIKE bsik-hkont,                  "General Ledger Account

       name1 LIKE lfa1-name1,                               "Name 1

       rebzg LIKE bseg-rebzg,                  "Number of the Invoice the Transaction Belongs to

       rebzj LIKE bseg-rebzj,                  "Fiscal Year of the Relevant Invoice (for Credit Memo)

*      ramnt LIKE bsik-dmbtr,                  " Running Amount

       ramnt TYPE p DECIMALS 2,                  " Running Amount

       gl2 TYPE bseg-hkont,

       txt50 TYPE skat-TXT50,

       XBLNR TYPE bsik-XBLNR,                     " Added By Neeraj Tiwari on 04-06-2014

       END OF itab3.

 

 

DATA: itab5 LIKE itab3 OCCURS 0 WITH HEADER LINE.

 

 

DATA : BEGIN OF itab4 OCCURS 0,

       bukrs LIKE bseg-bukrs,                  "Company Code

       gjahr LIKE bseg-gjahr,                  "Fiscal Year

       belnr LIKE bseg-belnr,                  "Accounting Document Number

       gsber LIKE bseg-gsber,                  "Business Area

       dmbtr LIKE bseg-dmbtr,                  "Amount in Local Currency

       hkont LIKE bseg-hkont,                  "General Ledger Account

       END OF itab4.

 

 

DATA : total TYPE p DECIMALS 2 VALUE 0,

       total0 TYPE i VALUE 0,

       total1 TYPE i VALUE 0,

       total2 TYPE i VALUE 0,

       total3 TYPE i VALUE 0,

       total4 TYPE i VALUE 0,

       totalx TYPE p DECIMALS 2 VALUE 0,

       total5 TYPE p DECIMALS 2 VALUE 0,

       total6 TYPE p DECIMALS 2 VALUE 0.

 

 

DATA: BEGIN OF it003t OCCURS 0,

         blart LIKE t003t-blart,               "Document Type

         ltext LIKE t003t-ltext,               "Document Type Description

      END OF it003t.

 

 

DATA: BEGIN OF iglt0 OCCURS   0,

        racct LIKE glt0-racct,                 "Account Number

        bukrs LIKE glt0-bukrs,                 "Company Code

        ryear LIKE glt0-ryear,                 "Fiscal Year

        hslvt LIKE glt0-hslvt,                 "Balance carried forward in local currency (currency 2)

      END OF iglt0.

 

 

DATA : BEGIN OF test OCCURS 0,

       field1 LIKE dd03l-fieldname,            "Field Name

       field2 LIKE dd03l-fieldname,            "Field Name

       field3 LIKE dd03l-fieldname,            "Field Name

       field4 LIKE dd03l-fieldname,            "Field Name

       END OF test.

 

 

 

 

TYPES: BEGIN OF ty_bseg,

        bukrs TYPE bseg-bukrs,

        belnr TYPE bseg-belnr,

        gjahr TYPE bseg-gjahr,

        HKONT TYPE bseg-HKONT,

 

 

      END OF ty_bseg.

 

 

TYPES: BEGIN OF ty_SKAT,

        SAKNR TYPE skat-SAKNR,

        TXT50 TYPE skat-TXT50,

       END OF ty_skat.

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

****                 DATA DECLARATION                               ****

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

 

 

DATA: it_bseg TYPE STANDARD TABLE OF ty_bseg,

      wa_bseg TYPE ty_bseg,

      it_skat TYPE STANDARD TABLE OF ty_SKAT,

      wa_skat TYPE ty_SKAT.

DATA  flag.

DATA: ilfc1 TYPE lfc1 OCCURS 0 WITH HEADER LINE.

DATA: ilfc3 TYPE lfc3 OCCURS 0 WITH HEADER LINE.

DATA  ilfa1 TYPE lfa1 OCCURS 0 WITH HEADER LINE.

DATA: ibsik TYPE bsik OCCURS 0 WITH HEADER LINE.

DATA: ibsak TYPE bsak OCCURS 0 WITH HEADER LINE.

DATA: lifnr_total(10) TYPE p DECIMALS 2.

DATA: lifnr_grtotal(10) TYPE p DECIMALS 2,

      bukrs_totals  TYPE p DECIMALS 2,                      "AL211002

      bukrs_grtotals TYPE p DECIMALS 2,

      clbal TYPE p DECIMALS 2,

      comp_bal TYPE p DECIMALS 2.                           "AL211002

DATA: mon(2) TYPE n, day(2) TYPE n.

mon = s_budat-low+4(2).

DATA :  f1 TYPE string, v1 TYPE string, v2 TYPE string,v3 TYPE i.

DATA: wrbtr TYPE bsik-wrbtr.

DATA: wrbtr1 TYPE bsik-wrbtr.

DATA: wrbtr2 TYPE bsik-wrbtr.

DATA: wrbtr3 TYPE bsik-wrbtr.

DATA: wrbtr4 TYPE bsik-wrbtr.

DATA: wrbtr5 TYPE bsik-wrbtr.

DATA: wrbtr6 TYPE bsik-wrbtr.

DATA: lv_dmbtr1 type bsik-dmbtr.

DATA: lv_dmbtr_d TYPE bsik-dmbtr.

DATA: lv_dmbtr_c TYPE bsik-dmbtr.

DATA: lv_dmbtr2 TYPE bsik-dmbtr.

DATA: p_budat TYPE bsik-budat.

DATA: keydat TYPE bsik-budat.

DATA: key_bal TYPE STANDARD TABLE OF BAPI3008_3 WITH HEADER LINE.

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

****                 START-OF-SELECTION                             ****

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

START-OF-SELECTION.

  PERFORM header.

*  PERFORM get_openbal.

  PERFORM getdata.

 

 

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

****                 AT SELECTION-SCREEN                            ****

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

AT SELECTION-SCREEN.

 

 

*  s_budat-sign = 'I'.

*  s_budat-option = 'BT'.

*  f1 = s_gjahr.

*  CONCATENATE f1 '04' '01' INTO v1.

*  s_budat-low = v1.

*  f1 = f1 + 1.

*  CONCATENATE f1 '03' '31' INTO v2 .

*  CONDENSE v2 NO-GAPS.

*  s_budat-high = v2.

*  APPEND s_budat.

 

 

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

*&      Form  GET_OPENBAL

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

FORM get_openbal .

  CLEAR: wrbtr4, wrbtr5, wrbtr6.

  LOOP AT ibsak WHERE lifnr = ilfa1-lifnr.

    IF ibsak-shkzg = 'H'.

      wrbtr = wrbtr + ibsak-wrbtr.

    ENDIF.

    IF ibsak-shkzg = 'S'.

      wrbtr1 = wrbtr1 + ibsak-wrbtr.

    ENDIF.

  ENDLOOP.

  LOOP AT ibsik WHERE lifnr = ilfa1-lifnr.

    IF ibsik-shkzg = 'H'.

      wrbtr2 = wrbtr2 + ibsik-wrbtr.

    ENDIF.

    IF ibsik-shkzg = 'S'.

      wrbtr3 = wrbtr3 + ibsik-wrbtr.

    ENDIF.

  ENDLOOP.

  wrbtr4 = wrbtr1 + wrbtr3.

  wrbtr5 = wrbtr + wrbtr2.

ENDFORM.                    " GET_OPENBAL

 

 

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

**&      Form  GETDATA

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

FORM getdata .

  DATA: lv_dmbtr LIKE bsik-dmbtr.

  DATA: zxreversal LIKE bkpf-xreversal.

  DATA: lifnr_delete1, lifnr_delete2, lifnr_delete3.

  DATA: lv_opbal LIKE bsik-dmbtr.

  DATA: v_gjahr LIKE bkpf-gjahr,

        v_monat LIKE bkpf-monat,

        v_poper LIKE t009b-poper,

        p_fy TYPE bkpf-gjahr.

  p_budat = s_budat-low - 1.

  SELECT * FROM bsik INTO CORRESPONDING FIELDS OF TABLE ibsik

                     WHERE bukrs IN s_bukrs

                     AND   lifnr IN s_lifnr

                     AND   budat LE p_budat.

*                     AND   budat in s_budat           " Added by Neeraj tiwari on 07-04-2014

*                     AND   gjahr = s_gjahr.           " Added by Neeraj tiwari on 07-04-2014

 

 

  SELECT * FROM bsak INTO CORRESPONDING FIELDS OF TABLE ibsak

                     WHERE bukrs IN s_bukrs

                     AND   lifnr IN s_lifnr

                     AND   budat LE p_budat.

*                     AND   budat in s_budat           " Added by Neeraj tiwari on 07-04-2014

*                     AND   gjahr = s_gjahr..         " Added by Neeraj tiwari on 07-04-2014

 

 

  SELECT * FROM lfa1 INTO CORRESPONDING FIELDS OF TABLE ilfa1

                     WHERE lifnr IN s_lifnr.

 

 

  SELECT * FROM lfc1 INTO CORRESPONDING FIELDS OF TABLE ilfc1

   WHERE bukrs IN s_bukrs

     AND lifnr IN s_lifnr

*     AND gjahr = s_gjahr.   " Commented BY Neeraj Tiwari on 31-05-2014

     AND gjahr in s_gjahr.   " Added By Neeraj Tiwari on 31-05-2014

 

 

  SORT ilfa1 BY lifnr.

 

 

  LOOP AT ilfa1.

 

 

    CLEAR: ilfc1, lifnr_delete1, lifnr_delete2, lifnr_delete3.

 

 

    READ TABLE ilfc1 WITH KEY lifnr = ilfa1-lifnr.

    IF NOT sy-subrc IS INITIAL.

      lifnr_delete1 = 'X'.

    ELSE.

      lifnr_delete1 = ''.

    ENDIF.

 

 

    SELECT * FROM bsik INTO CORRESPONDING FIELDS OF TABLE itab3

    WHERE bukrs IN s_bukrs

      AND lifnr EQ ilfa1-lifnr

*      AND gjahr EQ s_gjahr       " Commented By Neeraj Tiwari on 31-05-2014

       AND gjahr in s_gjahr        " Added By Neeraj Tiwari on 31-05-2014

      AND gsber IN s_gsber

      AND budat IN s_budat

      AND bstat NE 'S'.

 

 

    SELECT * FROM bsak APPENDING CORRESPONDING FIELDS OF TABLE itab3

    WHERE bukrs IN s_bukrs

      AND lifnr EQ ilfa1-lifnr

      AND budat IN s_budat

*      AND gjahr EQ s_gjahr     " Commented By Neeraj Tiwari on 31-05-2014

       AND gjahr in s_gjahr     " Added By Neeraj Tiwari on 31-05-2014

      AND gsber IN s_gsber

      AND bstat NE 'S'.

 

 

    itab5[] = itab3[].

 

 

*****check reversal****

    LOOP AT itab5.

 

 

      IF itab5-blart NE 'RE'.

        SELECT SINGLE xreversal FROM bkpf  INTO zxreversal WHERE bukrs  = itab5-bukrs

                                  AND belnr = itab5-belnr

                                  AND gjahr = itab5-gjahr.

 

 

        IF zxreversal IS NOT INITIAL.

*          DELETE itab3 WHERE bukrs  = itab5-bukrs

*                                    AND belnr = itab5-belnr

*                                    AND gjahr = itab5-gjahr.

        ENDIF.

      ELSE.

 

 

        SELECT SINGLE rebzg

                      rebzj

                      FROM bseg

                      INTO (itab5-rebzg,itab5-rebzj)

                      WHERE bukrs  = itab5-bukrs

                      AND   belnr = itab5-belnr

                      AND   gjahr = itab5-gjahr

                      AND   lifnr NE space.

 

 

        IF itab5-rebzg IS NOT INITIAL.

          DELETE itab3 WHERE belnr = itab5-rebzg AND gjahr = itab5-rebzj.

          DELETE itab3 WHERE belnr = itab5-belnr AND gjahr = itab5-gjahr.

        ENDIF.

        CLEAR: itab5-rebzg,itab5-rebzj.

      ENDIF.

    ENDLOOP.

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

    IF LINES( itab3 ) LE 0.

      lifnr_delete2 = 'X'.

    ELSE.

      lifnr_delete2 = ''.

    ENDIF.

 

 

    LOOP AT itab3 WHERE blart = 'RE'.

 

 

      SELECT *  FROM bseg INTO CORRESPONDING FIELDS OF TABLE itab4

                                 WHERE bukrs = itab3-bukrs

                                 AND gjahr = itab3-gjahr

                                 AND belnr = itab3-belnr

                                 AND gsber = itab3-gsber

                                 AND hkont = '0013170000'.

 

 

      LOOP AT itab4 WHERE belnr = itab3-belnr AND gjahr = itab3-gjahr.

        itab3-qbshb = itab3-qbshb + itab4-dmbtr.

      ENDLOOP.

 

 

      CLEAR : itab4[],itab4.

      MODIFY itab3.

    ENDLOOP.

 

 

    CLEAR: itab3, total, ilfc3.

 

 

    SELECT * FROM lfc3

            INTO CORRESPONDING FIELDS OF TABLE ilfc3

     WHERE bukrs IN s_bukrs

       AND lifnr EQ ilfa1-lifnr

*       AND gjahr = s_gjahr.      " Commented By Neeraj Tiwari on 31-05-2014

      AND gjahr in s_gjahr.       " Added By Neeraj Tiwari on 31-05-2014

 

 

    LOOP AT ilfc3.

      SUM.

    ENDLOOP.

 

 

    IF LINES( ilfc3 ) LE 0.

      lifnr_delete3 = 'X'.

    ELSE.

      lifnr_delete3 = ''.

    ENDIF.

 

 

    IF lifnr_delete1 = 'X' AND lifnr_delete2 = 'X' AND lifnr_delete3 = 'X'.

      CONTINUE.

    ENDIF.

 

 

    total = ilfc1-umsav + ilfc3-saldv.

 

 

*    SELECT SINGLE * FROM t001 WHERE bukrs = s_bukrs-low.

*    WRITE:/1 sy-vline,

*           3 t001-butxt COLOR 4,t001-bukrs COLOR 4,

*           210 sy-vline.

*

*    SELECT SINGLE * FROM lfa1 INTO lfa1 WHERE lifnr = ilfa1-lifnr.

*    WRITE : /1 sy-vline,

*             3 'Vendor                  :' COLOR 4,ilfa1-lifnr COLOR 4,lfa1-name1 COLOR 4,

*             210 sy-vline.

 

 

*    PERFORM get_openbal.

    PERFORM get_openbal1.

**    wrbtr6 = wrbtr4 - wrbtr5.

    WRITE:/1 sy-vline,

*     3 'Opening Balance         :' COLOR 4, (84) wrbtr4  COLOR 4, (16) wrbtr5 COLOR 4, (15) wrbtr6 COLOR 4,"25 total COLOR 4,  " cOMMENTED bY NEERAJ tIWARI

           3 'Opening Balance         :' COLOR 4,  (15) wrbtr6 COLOR 4,"25 total COLOR 4,   "Modified By neeraj Tiwari 14/01/2014

*           3 'Net Balance             :' COLOR 4, wrbtr6,

*           147 sy-vline,

236 sy-vline,

          sy-uline.

 

 

    SORT itab3 BY budat.

 

 

    DELETE itab3 WHERE blart = 'AB'.

    SORT itab3 BY budat.

    lv_dmbtr = wrbtr6.

 

 

************Added By Neeraj Tiwari on 25-04-2014 to get special gl****************************

 

 

    SELECT  bukrs

            belnr

            gjahr

            HKONT FROM bseg INTO TABLE it_bseg

      for ALL ENTRIES IN itab3

      WHERE bukrs = itab3-bukrs

      AND   belnr = itab3-belnr

      AND   gjahr = itab3-gjahr

      AND   KOART = 'S'.

 

 

    IF it_bseg[] IS NOT INITIAL.

      SELECT SAKNR TXT50 FROM skat INTO TABLE it_skat

        FOR ALL ENTRIES IN it_bseg

        WHERE SAKNR = it_bseg-hkont

        AND spras = 'EN'

        AND KTOPL = '9000'.

    ENDIF.

 

 

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

    LOOP AT itab3.

      IF itab3-shkzg = 'H'.

        IF itab3-qbshb NE 0.

          itab3-totalx =  itab3-dmbtr + itab3-qbshb.

        ENDIF.

        itab3-dmbtr = itab3-dmbtr * -1.

        MOVE itab3-dmbtr TO itab3-dmbtr_c.

      ELSE.

        MOVE itab3-dmbtr TO itab3-dmbtr_d.

      ENDIF.

**-- changes made on 07.04.2010 By Maruti

      itab3-ramnt = lv_dmbtr + ( itab3-dmbtr_d + itab3-dmbtr_c ).

      MODIFY itab3.

      lv_dmbtr = itab3-ramnt.

**--end of changes

 

 

*      total4 = total4 + itab3-dmbtr .

 

 

      MODIFY itab3.

 

 

      READ TABLE it_bseg INTO wa_bseg WITH KEY bukrs = itab3-bukrs belnr = itab3-belnr gjahr = itab3-gjahr.

      IF sy-subrc eq 0.

        itab3-gl2 = wa_bseg-hkont.

        READ TABLE it_skat INTO wa_skat WITH KEY SAKNR = wa_bseg-hkont.

        IF sy-subrc eq 0.

          itab3-TXT50 = wa_skat-TXT50.

        ENDIF.

      ENDIF.

 

 

      READ TABLE ilfc1 WITH KEY bukrs = itab3-bukrs lifnr = itab3-lifnr gjahr = itab3-gjahr.

      IF sy-subrc = 0.

        DELETE ilfc1 WHERE bukrs = itab3-bukrs AND lifnr = itab3-lifnr AND gjahr = itab3-gjahr.

      ENDIF.

 

 

      READ TABLE ilfc3 WITH KEY bukrs = itab3-bukrs lifnr = itab3-lifnr gjahr = itab3-gjahr.

      IF sy-subrc = 0.

        DELETE ilfc3 WHERE bukrs = itab3-bukrs AND lifnr = itab3-lifnr AND gjahr = itab3-gjahr.

      ENDIF.

 

 

      FORMAT COLOR 2 ON.

      WRITE :/ sy-vline,

               (13) itab3-budat,

*               sy-vline,

*               (12) itab3-bldat,

               sy-vline,

               (13) itab3-belnr,

               sy-vline,

               (8) itab3-blart CENTERED,

*               sy-vline,

*               (4) itab3-umskz,

*               sy-vline,

*               (6) itab3-gsber ,

               sy-vline,

               (50) itab3-sgtxt,

               sy-vline,

               (13) itab3-dmbtr_d NO-ZERO,

               sy-vline,

               (13) itab3-dmbtr_c NO-ZERO NO-SIGN,

*               sy-vline,

*               (13) itab3-qbshb NO-ZERO,

*               sy-vline,

*               (13) itab3-totalx NO-ZERO,

               sy-vline,

               (15) itab3-ramnt,      " Added by Maruti on 07.04.2010

               sy-vline,     " Added by Neeraj tiwari on 25-04-2014

      (13) itab3-gl2,      " Added by Neeraj tiwari on 25-04-2014

               sy-vline,

               (50) itab3-TXT50,      " Added by Neeraj tiwari on 25-04-2014

                sy-vline,             " Added by Neeraj Tiwari on 06-04-2014

               (17) itab3-XBLNR,       " Added by Neeraj Tiwari on 06-04-2014

               sy-vline..

      CLEAR totalx.

 

 

      FORMAT COLOR 2 OFF.

 

 

      CLEAR: lifnr_total.

    ENDLOOP.

**    PERFORM close_bal.

*    lv_dmbtr2 = lv_dmbtr1 + wrbtr6.

*    WRITE:/1 sy-vline,

*           / , (111) lv_dmbtr_d COLOR 4, (16) lv_dmbtr_c NO-SIGN COLOR 4,(18) lv_dmbtr1 COLOR 4,

*           /3 'Closing Balance        :' COLOR 4, (120) lv_dmbtr2 COLOR 4,

**           3 'Net Balance             :' COLOR 4, wrbtr6,

*           147 sy-vline,

*          sy-uline.

    clear : lv_dmbtr2,

             lv_dmbtr1.

    AT END OF lifnr.

      FORMAT COLOR 3 ON .

      LOOP AT itab3.

        SUM.

        EXIT.

      ENDLOOP.

 

 

      total5 = total5 + total3.

 

 

      lifnr_total =  itab3-dmbtr + itab3-dmbtr_d + itab3-dmbtr_c + total.

*      BUKRS_GRTOTALS = BUKRS_GRTOTALS + LIFNR_TOTAL .

 

 

      clbal = itab3-dmbtr_d + itab3-dmbtr_c + total.

 

 

      comp_bal = comp_bal + clbal.

 

 

*      WRITE:/ sy-uline(147).

      WRITE:/ sy-uline(236).

*      WRITE:/2 'Total:' , itab3-dmbtr_d UNDER itab3-dmbtr_d   NO-ZERO COLOR 1,

*                          itab3-dmbtr_c UNDER itab3-dmbtr_c  NO-ZERO NO-SIGN COLOR 1,

*                          itab3-qbshb   UNDER itab3-qbshb    NO-ZERO   COLOR 1,

*                          itab3-totalx  UNDER itab3-totalx   NO-ZERO  COLOR 1,

*

      WRITE:/2    ' Closing Balance :', LV_DMBTR COLOR 3. " lifnr_total

      CLEAR : total3, total.

      total6 = total6 + clbal.

 

 

 

 

*      WRITE:/ sy-uline(147).

      WRITE:/ sy-uline(236).

      FORMAT COLOR 3 OFF.

    ENDAT.

 

 

  ENDLOOP.

 

 

*      SUM.

*  FORMAT COLOR 5 ON.

*  SKIP.

*  WRITE:/ 'Total of all company codes:',total6 .

*  FORMAT COLOR 5 OFF RESET..

 

 

ENDFORM.                    " GETDATA

 

 

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

*&      Form  HEADER

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

FORM header .

  WRITE: s_budat-low  TO sy-tvar0.

  WRITE: s_budat-high TO sy-tvar1.

 

 

*  WRITE: s_gjahr-low to sy-tvar0.

*  WRITE: s_gjahr-high to sy-tvar1.

 

 

ENDFORM.                    " HEADER

 

 

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

****                 TOP-OF-PAGE                                    ****

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

TOP-OF-PAGE.

  DATA butxt TYPE t001-butxt.

  SELECT SINGLE * FROM t001 WHERE bukrs = s_bukrs-low.

  WRITE:/1 sy-vline,

         40 t001-butxt COLOR 4,t001-bukrs COLOR 4,

         147 sy-vline.

 

 

  SELECT SINGLE * FROM lfa1 INTO lfa1 WHERE lifnr = ilfa1-lifnr.

  WRITE : /1 sy-vline,

           40 'Ledger Of Vendor' COLOR 4, lfa1-name1 COLOR 4, 'From' , s_budat-low COLOR 4, 'to', s_budat-high COLOR 4, '(',ilfa1-lifnr COLOR 4,')',

           147 sy-vline.

  WRITE : /1 sy-vline, 40 'Fiscal Year' COLOR 4, s_gjahr-low, 'to' ,s_gjahr-high,147 sy-vline.

  SELECT SINGLE butxt FROM t001 INTO butxt

                      WHERE bukrs EQ s_bukrs-low.

 

 

  WRITE:/40 'VENDOR ACCOUNT STATAMENT'.

  SKIP 1.

 

 

*  WRITE:/4 'Company Name :' , butxt.

*  CLEAR sy-subrc.

*  WRITE:/4 'Period       : From', s_budat-low, 'to', s_budat-high.

*  SKIP.

 

 

*  WRITE:sy-uline(147).

  WRITE:sy-uline(236).

  WRITE :/ sy-vline,

           (13) 'POSTING DATE',

*           sy-vline,

*           (12) 'DOCDATE' ,

           sy-vline,

           (13) 'DOCUMENT NO.',

           sy-vline,

           (8) 'DOC TYPE' ,

*           sy-vline,

*           (4) 'SPGL',

*           sy-vline,

*           (6) 'B Area',

           sy-vline,

           (50) 'ITEM TEXT ' CENTERED,

           sy-vline,

           (13) 'DEBIT AMOUNT',

            sy-vline,

           (13) 'CREDIT AMOUNT' ,

*           sy-vline,

*           (13) 'TDS AMT',

*           sy-vline,

*           (13) 'BILL AMOUNT',

           sy-vline,

           (15) 'RUNNING BALANCE',  " Added by MAruti on 07.04.2010

           sy-vline,

 

 

           (13) 'SECONDARY GL',  " Added by Neeraj Tiwari on 25-04-2014

           sy-vline,

           (50) 'SECONDARY GL NAME',  " Added by Neeraj Tiwari on 25-04-2014

           sy-vline,

           (17) 'Reference',  " Added by Neeraj Tiwari on 04-06-2014

           sy-vline

           .

 

 

*  WRITE:sy-uline(147).

  WRITE:sy-uline(236).

 

 

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

****                 END-OF-PAGE                                    ****

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

END-OF-PAGE.

*  WRITE:sy-uline(147). "217

  WRITE:sy-uline(236).

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

*&      Form  CLOSE_BAL

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

*       text

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

*  -->  p1        text

*  <--  p2        text

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

FORM close_bal .

  LOOP AT itab3.

    lv_dmbtr_d = lv_dmbtr_d + itab3-dmbtr_d.

    lv_dmbtr1 = lv_dmbtr1 + itab3-ramnt.

    lv_dmbtr_c = lv_dmbtr_c + itab3-dmbtr_c.

  ENDLOOP.

ENDFORM.                    " CLOSE_BAL

 

 

 

 

FORM get_openbal1.

  CLEAR: wrbtr6,key_bal[].

  CONCATENATE s_gjahr-low '03' '31' INTO keydat.

  CALL FUNCTION 'BAPI_AP_ACC_GETKEYDATEBALANCE'

    EXPORTING

      COMPANYCODE        = s_bukrs-low

      VENDOR             = ilfa1-lifnr

      KEYDATE            = keydat

*   BALANCESPGLI       = ' '

*   NOTEDITEMS         = ' '

* IMPORTING

*   RETURN             =

    TABLES

      KEYBALANCE         = key_bal

            .

  IF key_bal[] IS NOT INITIAL.

    READ TABLE key_bal index 1.

    wrbtr6 = key_bal-LC_BAL.

  ENDIF.

 

 

ENDFORM.

BAPI to convert J_3GEMPRO

$
0
0

Hello guys if you go to J_3GBELP from SE16N tcode, you can see the fields J_3GEMPRO and J_3GEMPSP, but shows other information:

Sin título.png

you need go in from SE16:

datosbien.PNG

as you can see _3GEMPRO and J_3GEMPSP has numeric information, to show information like other screen you need run the BAPI  CONVERSION_EXIT_ABPSP_OUTPUT this is only for J_3GEMPSP

Captura.PNG

I think the J_3 GEMPRO is ever the seven first numbers of J_3GEMPSP but Im not sure.

Please help

statement is not accessible in call function

$
0
0

hi when i going to activate this alv report i m geting statement is not accessible please help me getting fix in this issue

 

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

*& Report  ZSG_ALV

*&

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

*&

*&

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

 

REPORT  ZSG_ALV.

TABLEs: mara.

TYPE-POOLS : SLIS.

TYPES: BEGIN OF ty_mara,

        matnr TYPE matnr,

        mtart TYPE mtart,

        MBRSH TYPE MBRSH,

        matkl TYPE matkl,

        END OF ty_mara.

 

data : it_mara TYPE STANDARD TABLE OF ty_mara,

        wa_mara TYPE ty_mara,

        FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,

        GD_REPID like sy-repid.

GD_REPID = SY-REPID.

 

 

SELECT-OPTIONS s_matnr for mara-matnr.

 

START-OF-SELECTION.

SELECT matnr mtart MBRSH matkl FROM mara into TABLE it_mara WHERE

matnr in s_matnr.

 

PERFORM build_fieldcatalog.

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

*&      Form  BUILD_FIELDCATALOG

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

*       text

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

*  -->  p1        text

*  <--  p2        text

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

form BUILD_FIELDCATALOG .

 

FIELDCATALOG-col_pos = 0.

FIELDCATALOG-fieldname = 'matnr'.

FIELDCATALOG-seltext_m = 'MATERIAL NO'.

APPEND FIELDCATALOG to FIELDCATALOG.

CLEAR FIELDCATALOG.

 

   FIELDCATALOG-col_pos = 1.

   FIELDCATALOG-fieldname = 'mtart'.

   FIELDCATALOG-seltext_m = 'MATERIAL TYPE'.

   APPEND FIELDCATALOG TO FIELDCATALOG.

   CLEAR FIELDCATALOG.

 

   FIELDCATALOG-col_pos = 2.

   FIELDCATALOG-fieldname = 'mbrsh'.

   FIELDCATALOG-seltext_m = 'Industry sector'.

   APPEND FIELDCATALOG TO FIELDCATALOG.

   CLEAR FIELDCATALOG.

 

 

   FIELDCATALOG-col_pos = 3.

   FIELDCATALOG-fieldname = 'matkl'.

   FIELDCATALOG-seltext_m = 'material group'.

   APPEND FIELDCATALOG TO FIELDCATALOG.

   CLEAR FIELDCATALOG.

 

endform.                    " BUILD_FIELDCATALOG

 

  PERFORM DISPLAY_ALV_REPORT.

 

 

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

*&      Form  DISPLAY_ALV_REPORT

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

*       text

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

*  -->  p1        text

*  <--  p2        text

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

form DISPLAY_ALV_REPORT .

   CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

   EXPORTING

     i_callback_program = GD_REPID

*  is_layout          = w_layout

     it_fieldcat        = FIELDCATALOG[]

*  it_events          = i_events

   TABLES

     t_outtab           = it_mara

   EXCEPTIONS

     program_error      = 1

     OTHERS             = 2.

   IF sy-subrc <> 0.

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

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

   ENDIF.

 

endform.                    " DISPLAY_ALV_REPORT

Error 'No RFC authorization for function module XAB_READ'.

$
0
0

HI All,

         i am new to workflow, i created a custom program in which i am using function module ' SWE_EVENT_CREATE' to trigger an business object

         using an event , but the program was not excuting.when i cheked in trace , i got the below error.

        

       Screen shot attached, Help Required.

 

 

        Thanks

        Prakash


Problem while updating tcodes from tstc to Ztable

$
0
0

Hi Guys,

 

I have a program which updates tcodes from tstc table into a Ztable.

It has to be run on daily basis as a background job.

My problem is that if I create a new Tcode it will update only that tcode into custom table but before that it compares all the entries of tstc and ztable which is impacting the overall performance.

I means if I am having 100000 entries in both the tables and if I create a new tcode then to update only that record, I have to create a loop which will iterate for 100000 times.

Can anyone please suggest me any method which will improve the performance of report?

 

 

 

Thanks,

Neha

How to page split in script

$
0
0

Hi Experts,

 

I have a requirement to do page split in sap script means, in main window each header data 10 line items is there suppose one header under 10 line item was showed then for next header data have not proper  space  in first page for 10 line items then it should show next page all second header data plus all line item data under header data.But i have used protect..endprotect command for this requirement its not working. Anyone can help me for this requirement.

 

Thanks,

How to add events to Business Objects

$
0
0

Dear Experts

 

We are working with workflows, for one of object Notification, business object BUS2080, we want to trigger an event after change of certain fields.

Since standard BO does not cater for change, we would like to explore other alternatives to solve this.

 

Appreciate your kind information and co-operation.

 

Thanks in Advance

Praveen

Call Transaction MIGO to Display Material Document

$
0
0

Sometimes, Customers want to display material document in MIGO.

 

I call transaction MIGO and set Parameter ID MBN(Material Document Number) and MJA(Material Document Year) in my own program, and call transaction MIGO, just like this.


set parameter id MJA field mblnr.
set parameter id MJA field mjahr.
call transaction 'MIGO' and skip first screen.

 

The material document is displayed sometimes, but sometimes not.

The reason is that if you want to display Material Document in MIGO,

the 'Action' would better be A04->Display and the 'REFDOC' must be R02->Display.

But if I go into MIGO with Action A01(Goods Receipt) and REFDOC R01(Purchase Order), and then I exit from MIGO.

The next time, I go into MIGO the value of Action is A01 and the value of REFDOC is R01; In this case, if you call migo to display material document, the document will not be displayed.

why this, because SAP set default values for MIGO.


User defaults are stored in table 'ESDUS'. For more info, refer to CLASS: CL_MMIM_USERDEFAULTS .


So, we just need to set user default value for MIGO before we call transaction 'MIGO'.

 

Solution:

PERFORM set_migo_defaults USING 'A04' 'R02'.
FORM set_migo_defaults USING p_action TYPE godynpro-action
 p_refdoc TYPE godynpro-refdoc.
 DATA: lo_mmim_settings  TYPE REF TO cl_mmim_userdefaults,
 l_history         TYPE es_active.
 CREATE OBJECT lo_mmim_settings
 EXPORTING
 *      i_uname = sy-uname
 i_action = 'MIGO_FIRSTLINE'.
 *$ Update filed history data
 l_history = lo_mmim_settings->get( 'ACTION_HISTORY' ).
 REPLACE p_action IN l_history WITH space.
 CONCATENATE l_history
 p_action
 INTO l_history
 SEPARATED BY space.
 CONDENSE l_history.
 CALL METHOD lo_mmim_settings->set
 EXPORTING
 i_element = 'ACTION_HISTORY'
 i_active  = l_history.
 *$ Update current entries
 CALL METHOD lo_mmim_settings->set
 EXPORTING
 i_element = 'ACTION'
 i_active  = p_action.
 CALL METHOD lo_mmim_settings->set
 EXPORTING
 i_element = p_action
 i_active  = p_refdoc.
 CALL METHOD lo_mmim_settings->flush.
 ENDFORM.

Problem when error message in exit Save document prepare(MV50AFZ1) on PGI

$
0
0

Hi,

 

I am using USER_EXIT_DOCUMENT_PREPARE for throwing error message during PGI. The error triggers properly, but after that if I press enter button, the program ends with an ABEND error "Risk of posting several mat.documents for one delivery->long text".

 

In the EXIT code no change any data, only check, and when I comment exit code the PGI finish without problems.

 

when press save and not PGI, message error finish OK.

 

I have SAP 460c.

 

Thanks in Adv.

Regards

Matías

Viewing all 8332 articles
Browse latest View live


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