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

Regarding Table Content in Module Pool

$
0
0

Q. How to pass data from table content cells  to internal table in Module Pool.........

Example........

 

Like    Price column

           5,00        

This $5,00 will be showing in Price column of Internal Table.


Union tables in query

$
0
0

Dear Friends,

 

 

Could you give me some guidence about how to union tables in SQ02?

I put the table MSSL into "Alias tables",  but no use here.

Now I want to make  query to list the stock and value of packaging materials.

I use the table MARD as the basic stock table, MBEW to find the price and MVKE to ensure packaging materials.

But we want vendor stock also. Could you help to to add table MSSL into the list?

Thank you very much!

 

 

Best regards,

Peter

FM SUBST_GET_FILE_LIST no longer available in Release 702 ?

$
0
0

We are in the process of upgrading to ECC 6 Release 702. In the new release, the standard Function Module SUBST_GET_FILE_LIST (which is used to get a list of files on an application server directory), has all its code commented out and replaced by a single statment "raise ACCESS_ERROR".

 

There is an SAP "security" note 1555144 which mentioned FM SUBST_GET_FILE_LIST as a security risk and recommends that FM  SUBST_GET_FILE_LIST be disabled using the "raise ACCESS_ERROR" statement. However, there seems to be no mention of an alternative FM or method that can be used to work around the security issue. There is really nothing to stop us from creating our own custom Z version of the FM, but then the security issue will still be there.

 

Has anyone else out there come across this issue and if so what was your approach in working around this ?

 

Thanks in advance.

Alvin

re: abapers problem in migo

$
0
0

hi gurus

 

/h

 

when iam doing migo for a po no when i click on check push button it is checking for every lineitems, it should check only once

and should display only one display log message. here is the screen shot iam displaying in file below.

 

/h

 

with warm regards

nagaraj

Execute BAPI_DOCUMENT_CREATE2 in background mode

$
0
0

Hi,

 

I need to create a DMS document with PDF attachment from Application Server in background mode.

I'm calling the function BAPI_DOCUMENT_CREATE2 in an external application, but it stopped when I call function RFC_START_PROGRAM destination BACK. What does mean "destination BACK"?

Is it possible?

Are there any other ways to solve this issue?

 

 

Thanks in advance,

devoloping the BDC For material schedule update for me38 but gives the error :-BDC_INSERT, session not opened

$
0
0

report ZBDC_ME38
        no standard page heading line-size 255.
*include bdcrecx1.
*parameters: dataset(132) lower case.
*** DO NOT CHANGE - the generated data section - DO NOT CHANGE    ***
*
*   If it is nessesary to change the data section use the rules:
*   1.) Each definition of a field exists of two lines
*   2.) The first line shows exactly the comment
*       '* data element: ' followed with the data element
*       which describes the field.
*       If you don't have a data element use the
*       comment without a data element name
*   3.) The second line shows the fieldname of the
*       structure, the fieldname must consist of
*       a fieldname and optional the character '_' and
*       three numbers and the field length in brackets
*   4.) Each field must be type C.
*
*** Generated data section with specific formatting - DO NOT CHANGE  ***

DATA: file_path TYPE string.

DATA: I_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
*
data: begin of record OCCURS 0,
         EVRTN_001(010),
         EBELP_002(005),
         ETNR1_003(004),
         LPEIN_04_004(001),
         EEIND_04_005(010),
         MENGE_04_006(017),
       end of record.


START-OF-SELECTION.


   SELECTION-SCREEN BEGIN OF BLOCK mode WITH FRAME TITLE text-003.

   PARAMETERS: file_url TYPE  rlgrap-filename MODIF ID xyz .

   SELECTION-SCREEN END OF BLOCK mode .

*PARAMETERS: dataset(132) lower case.
*perform open_dataset using dataset.
*Uploading data from the local file C:\MSchedule.txt
*CALL FUNCTION 'WS_UPLOAD'
* EXPORTING
*   FILENAME                      = 'C:\MSCHEDULE.TXT'
*   FILETYPE                      = 'DAT'
*  TABLES
*    data_tab                      = I_BDCDATA .
*
*IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
*ENDIF.



AT SELECTION-SCREEN ON VALUE-REQUEST FOR file_url.
   CALL FUNCTION 'F4_FILENAME'
     EXPORTING
       program_name  = syst-cprog
       dynpro_number = syst-dynnr
       field_name    = 'FILE_URL'
     IMPORTING
       file_name     = file_url.

   start-of-selection.

   IF NOT file_url IS INITIAL.

     MOVE  file_url TO file_path.
     PERFORM read_file.
   ENDIF.


perform open_group.
perform close_group. "Closing the BDC session
LOOP AT RECORD. "Filling the BDC table with data

*read dataset dataset into record.

perform bdc_dynpro      using 'SAPMM06E' '0205'.
perform bdc_field       using 'BDC_CURSOR'
                               'RM06E-EVRTN'.
perform bdc_field       using 'BDC_OKCODE'
                               '/00'.
perform bdc_field       using 'RM06E-EVRTN'
                               record-EVRTN_001.
perform bdc_dynpro      using 'SAPMM06E' '0222'.
perform bdc_field       using 'BDC_CURSOR'
                               'EKPO-EMATN(01)'.
perform bdc_field       using 'BDC_OKCODE'
                               '=ET'.
perform bdc_field       using 'RM06E-EBELP'
                               record-EBELP_002.
perform bdc_dynpro      using 'SAPMM06E' '1117'.
perform bdc_field       using 'BDC_CURSOR'
                               'EKET-MENGE(04)'.
perform bdc_field       using 'BDC_OKCODE'
                               'BU'.
perform bdc_field       using 'RM06E-ETNR1'
                               record-ETNR1_003.
perform bdc_field       using 'RM06E-LPEIN(04)'
                               record-LPEIN_04_004.
perform bdc_field       using 'RM06E-EEIND(04)'
                               record-EEIND_04_005.
perform bdc_field       using 'EKET-MENGE(04)'
                               record-MENGE_04_006.
perform bdc_dynpro      using 'SAPLSPO1' '0300'.
perform bdc_field       using 'BDC_OKCODE'
                               '=YES'.
perform bdc_transaction using 'ME38'.
ENDLOOP.



FORM read_file .
   CALL FUNCTION 'GUI_UPLOAD'
     EXPORTING
       filename                      = file_path
      filetype                       = 'ASC'
      has_field_separator            = 'X'
*   HEADER_LENGTH                 = 0
      read_by_line                   = 'X'
*   DAT_MODE                      = ' '
*   CODEPAGE                      = ' '
*   IGNORE_CERR                   = ABAP_TRUE
*   REPLACEMENT                   = '#'
*   CHECK_BOM                     = ' '
* IMPORTING
*   FILELENGTH                    =
*   HEADER                        =
     TABLES
       data_tab                      = record
* 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.

ENDFORM.                    " read_file



*perform close_dataset using dataset.
FORM OPEN_GROUP.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
GROUP = 'SESSION1'
USER = SY-UNAME
KEEP = 'X'.
IF SY-SUBRC <> 0.
WRITE 'ERROR IN OPEN_GROUP'.
ENDIF.
ENDFORM.

FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR I_BDCDATA.
I_BDCDATA-PROGRAM = PROGRAM.
I_BDCDATA-DYNPRO = DYNPRO.
I_BDCDATA-DYNBEGIN = 'X'.
APPEND I_BDCDATA.
ENDFORM.

FORM BDC_FIELD USING FNAM FVAL.
CLEAR I_BDCDATA.
I_BDCDATA-FNAM = FNAM.
I_BDCDATA-FVAL = FVAL.
APPEND I_BDCDATA.
ENDFORM.

FORM BDC_TRANSACTION USING TCODE.
CALL FUNCTION 'BDC_INSERT'
EXPORTING TCODE = TCODE
TABLES DYNPROTAB = I_BDCDATA.
ENDFORM.

FORM CLOSE_GROUP.
CALL FUNCTION 'BDC_CLOSE_GROUP'.
ENDFORM. " CLOSE_GROUP

ALV Tree Subtotal

$
0
0

Dear All,

 

I'm working on a ALV tree using cl_gui_alv_tree. My requirement is to calculate the percentage of column B in the header node using the subtotal value of column A.

 

However, when using CALL METHOD g_alv_tree->GET_OUTTAB_LINE after CALL METHOD g_alv_tree->update_calculations, the subtotal value is returning 0 value. Please let me know how to get the subtotal value in the header node.

 

Thank you.

Suppress F1 help popup

$
0
0

Hi,

 

Is there any way by which we could suppress the F1 help performance assistant pop up?

I could not find any BADI or enhancement where this could be done.

 

Thanks,

Gauri


RE: abapers problem in migo

$
0
0

hi gurus

 

/h

this is my code, and in migo if i click on check it is checking for all lineitems, it should check for only one line item and display log message should be displayed for one lineitem.

 

if sy-tcode = 'MIGO' OR sy-tcode = 'MIGO_GR'.

 

  Data :  BUKRS LIKE  BKPF-BUKRS,

DATE   LIKE  SY-DATUM,

CURRY  LIKE  BKPF-GJAHR.

Data : Begin of it_mseg occurs 0,

       mblnr like mseg-mblnr,

*       bwart like mseg-bwart,

*       gjahr like mseg-gjahr,

*       lifnr like mseg-lifnr,

       END OF it_mseg.

 

 

Data : Begin of it_mkpf occurs 0 ,

       mblnr like mkpf-mblnr,

        xblnr like mkpf-xblnr,

*        frbnr like mkpf-frbnr,

*       bwart like mseg-bwart,

*       gjahr like mseg-gjahr,

*       lifnr like mseg-lifnr,

       END OF it_mkpf.

 

 

Data : Begin of it_mkpf2 occurs 0 ,

         mblnr like mkpf-mblnr,

         frbnr like mkpf-frbnr,

       END OF it_mkpf2.

 

 

Data : Begin of it_mkpf3 occurs 0 ,

       mblnr like mkpf-mblnr,

        frbnr like mkpf-frbnr,

       END OF it_mkpf3.

 

 

Data :     ref  type mkpf-xblnr,

            bol type mkpf-frbnr.

 

 

Data : doc_no type mkpf-mblnr,

            inv_no type mkpf-xblnr,

            output  type string.

 

 

read TABLE mkpf.

Bukrs = '8888'.

DATE =  mkpf-budat.

 

 

 

 

CALL FUNCTION 'GET_CURRENT_YEAR'

EXPORTING

   BUKRS         = Bukrs

   DATE          = DATE

IMPORTING

*   CURRM         =

   CURRY         = CURRY

*   PREVM         =

*   PREVY         =

          .

     if mseg is not INITIAL.

  read TABLE mseg .

if mseg-bwart = '101'.

 

    

select mblnr from mseg

into table  it_mseg

where bwart = mseg-bwart

and lifnr = mseg-lifnr

and gjahr = curry.

 

   if it_mseg[] is not INITIAL.

delete ADJACENT DUPLICATES FROM it_mseg COMPARING mblnr.

 

select mblnr xblnr  from mkpf

into table it_mkpf

FOR ALL ENTRIES IN it_mseg

where mblnr = it_mseg-mblnr

and   xblnr = mkpf-xblnr.

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

if it_mkpf[] is not initial.

Read table it_mkpf index 1.

clear : doc_no,

            inv_no,

            output.

doc_no = it_mkpf-mblnr.

inv_no = it_mkpf-xblnr.

 

 

Concatenate 'This  DC No:' Inv_no 'Available For Doc No : ' doc_no into  output

separated by space.

Message  output  Type 'E'.

  endif.

  select mblnr frbnr from mkpf

into table it_mkpf2

FOR ALL ENTRIES IN it_mseg

where mblnr = it_mseg-mblnr

and   frbnr = mkpf-frbnr.

                 

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

if it_mkpf2[] is not INITIAL.

Read table it_mkpf2 index 1.

clear : doc_no,

            inv_no,

            output.

 

doc_no = it_mkpf2-mblnr.

inv_no = it_mkpf2-frbnr.

 

   Concatenate 'This Invoice No:' inv_no 'Available For Doc No : ' doc_no into  output

separated by space.

 

Message  output  Type 'E'.

 

/h

 

with warm regards

nagaraj

Not getting the output using for all entries-

$
0
0

Pls rely me....the values are not fetching for this select query...............


SELECT MAtnr

       MTART

       MBRSH

       MATKL

       MEINS

       GEWEI

       SPART

   from mara

   INTO TABLE it_mara

   where matnr in s_matnr.

 

IF  sy-subrc = 0.

   SELECT MATNR

            BWKEY

            VPRSV

            STPRS

        FROM mbew

        INTO TABLE it_mbew

        FOR ALL ENTRIES IN it_mara

        where matnr = it_mara-matnr.

     endif.

   IF sy-subrc = 0.

     SELECT MATNR

             SPRAS

       FROM makt

       INTO TABLE it_final

       FOR ALL ENTRIES IN it_mara

       WHERE matnr = it_mara-matnr.

 

   ENDIF.

   IF sy-subrc = 0.

        SELECT matnr

               werks

               ekgrp

          FROM marc

          INTO TABLE it_marc

          FOR ALL ENTRIES IN it_mara

          where matnr = it_mara-matnr.

   ENDif.

LOOP AT it_mara INTO wa_mara.

     READ TABLE it_mara INTO wa_mara WITH KEY matnr = wa_mara-matnr.

   wa_final-matnr = wa_mara-matnr.

   wa_final-Mtart = wa_mara-mtart.

   wa_final-mbrsh = wa_mara-mbrsh.

   wa_final-matkl = wa_mara-matkl.

   wa_final-meins = wa_mara-gewei.

   wa_final-spart = wa_mara-spart.

     READ TABLE it_mbew INTO wa_mbew with key matnr = wa_mara-matnr.

   IF sy-subrc = 0.

     wa_final-stprs = wa_mbew-stprs.

     wa_final-vprsv = wa_mbew-vprsv.

     wa_final-bwkey = wa_mbew-bwkey.

   ENDIF.

   READ TABLE it_marc INTO wa_marc WITH key matnr = wa_mara-matnr.

   IF sy-subrc = 0.

     wa_final-werks = wa_marc-werks.

     wa_final-ekgrp = wa_marc-ekgrp.

   ENDIF.

   READ TABLE it_makt INTO wa_makt WITH KEY matnr = wa_mara-matnr.

   IF sy-subrc = 0.

     wa_final-spras = wa_makt-spras.

   ENDIF.

 

   APPEND wa_final to it_final.

CLEAR wa_final.

ENDLOOP.

How to convert time from one time zone to another ?

$
0
0

Hello Experts ,

 

  How to convert the time from one time zone to another. Basically i have the following data with me :

 

Data , CST time . I need to convert this to Japanese (JST) time zone.

 

 

Also please guide me is it the right time zone value i am using for japanese. I.e JST.

 

Thanks and Regards,

NIkhil Kulkarni

Issue related For All Entries

$
0
0

H, I have to pick up BELNR by passing  MSEG-LFBNR using for all entries to RSEG-LFBNR . I am getting only 1 BELNR because of for all entries. But I want more than 1 BELNR. Can anyone suggest me solution to this problem? Thanks in advance.

Thai text display as Junk

$
0
0

Dear Experts,

 

We have installed France language in 4.7e since than we are facing some problem is as follows.

Where ever we use Read_Text function and if the text is in Thai language that text will be displayed as junk data this is happening for all the documents created before the France laungauge installed but for the documents created after the France language installed have no problem.

 

Please let me know if anyone gone through this type of problem or have any solution.

 

Thanks in Advance

 

Best Regards

Venkat

validation on user name and password on the initial screen?

$
0
0

how can i make a report having validation on user name and password on the initial screen?

Function Module to archiving file in Application server

$
0
0

This Function Module is mainly used in Interface type of objects.

One specific selection screen frame must be added to feed the function module call for each file read (with file name and repository for archiving).

 

Function module ZFILE_ARCHIVE is created for that purpose.

 

Local Interface:

IMPORTING

VALUE(I_SFILE) TYPE LOCALFILE (Source Filepath)

VALUE(I_DPATH) TYPE LOCALFILE (Destination Filepath)

VALUE(I_FILENAME) TYPE LOCALFILE (Filename)

EXCEPTIONS

ERROR_OPENING_SOURCE_FILE

ERROR_OPENING_TARGET_FILE

 

In the source code write the below code:

 

* Variables

  DATA :  lv_data TYPE string,
          lv_len  TYPE char02,
          lv_archvive TYPE localfile.

 

  lv_len = strlen( i_filename ).
  lv_len = lv_len - 4.


* Filename has extension or not

  IF i_filename+lv_len(1) EQ '.'.
   lv_archvive = i_dpath.
  ELSE.

    CONCATENATE i_dpath   " Destination path
            i_filename    " File name without extension
            sy-datum      " Sys date
            sy-uzeit      " Sys time
     INTO lv_archvive.

  ENDIF.

 

  OPEN DATASET i_sfile IN LEGACY TEXT MODE FOR INPUT IGNORING CONVERSION ERRORS.
  IF sy-subrc NE 0.
    RAISE error_opening_source_file.
  ENDIF.

 

  OPEN DATASET lv_archvive IN LEGACY TEXT MODE FOR APPENDING IGNORING CONVERSION ERRORS.
  IF sy-subrc NE 0.
    RAISE error_opening_target_file.
  ENDIF.


* copy the file from source to destination

  DO.
    READ DATASET i_sfile INTO lv_data.
    IF sy-subrc EQ 0.
      TRANSFER lv_data TO lv_archvive.
      CLEAR lv_data.
    ELSE.
      EXIT.
    ENDIF.
  ENDDO.


* Delete the source file after copy

  DELETE DATASET i_sfile.


* Close all open dataset

  CLOSE DATASET: i_sfile,
                 lv_archvive.

  CLEAR : lv_data.

 

Eg:

Selection Screen

Archieve Selection Screen.jpg

Logical Path for Source File is the path from where the file is retrieved from Application Server.

Logical Path for archieve file is the path to where the file is archieved to the Application Server using the Function Module 'ZFILE_ARCHIVE'.


Regarding Table Content in Module Pool

$
0
0

Q. How to pass data from table content cells  to internal table in Module Pool.........

Example........

 

Like    Price column

           5,00        

This $5,00 will be showing in Price column of Internal Table.

cursor positon of table control in module pool

$
0
0

Hi

 

I am using table control inside tabstrip ie there is one screen (say 100 for tabstrip ) and one subscreen  (say 0011 for tablecontrol). And there is a display button on screen 100 for selection of row of table control.

for that I did coding on flow logic of subscreen as

 

PROCESS BEFORE OUTPUT.
* MODULE STATUS_0011.
   LOOP AT    GIT_ITEMS
         INTO    GWA_ITEMS
         WITH CONTROL ITEM_TABLE
         CURSOR ITEM_TABLE-CURRENT_LINE.
   ENDLOOP.


PROCESS AFTER INPUT.
   LOOP AT GIT_ITEMS .
     MODULE UPDATE_TABLE.
   ENDLOOP.

 

MODULE UPDATE_TABLE INPUT.
   READ TABLE GIT_ITEMS INTO GWA_ITEMS INDEX ITEM_TABLE-CURRENT_LINE.
   IF  MARK IS NOT INITIAL.
     GWA_ITEMS-SEL = 'X'.
     MODIFY GIT_ITEMS FROM GWA_ITEMS TRANSPORTING SEL WHERE SEL <> 'X'.
     CLEAR GWA_ITEMS.
   ENDIF.

 

 

and on screen

case sy-ucomm.

WHEN 'DIS'.
       LOOP AT  GIT_ITEMS INTO GWA_ITEMS WHERE SEL = 'X'  .
         SEL_MAT   = GWA_ITEMS-MATERIAL.
         SEL_PLANT = GWA_ITEMS-PLANT.
         SEL_DIS    = GWA_ITEMS-DECSRIP.
         SEL_SLOC  = GWA_ITEMS-S_LOC.
       ENDLOOP.

 

but after selecting a row mark is not getting filled(always initial)

Reading Cluster Table "ZES" .

$
0
0

Hello All,

I am reading Cluster table "ZES" to calculate Accruals and usage based on date in my report.(Inital ALV contains Quota and its validty date as output) . Now if i chose a specific quota i need to query "ZES" Cluster based on the validty date and quota. I can match the quota selected with the field 'ZTART'(Time Type) but cluster doesnt have a field to compare the date.

 

Please sugggest.


Thanks

Prabaharan

How to change confirmed quantity in shedule lines of sales order?

$
0
0

Hi Experts,

 

         i have gone through the SDN for chage confirmed quantity but i couldn't trace it.

         So please suggest me how to change confirmed quantity at schedule lines of sales order.

          i have gone through the Bapi's : BAPI_SALESDOCUMENT_CHANGE

                                                         BAPI_SALESORDER_CHANGE.

          please help me.

 

 

Thanks & Regards,

Dinesh.K

BAPI for T. Code ABAA

Viewing all 8332 articles
Browse latest View live


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