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

Issue with KEFC transaction

$
0
0

Hi sdners,

 

I've a problem with the KEFC transaction. After upgrading from 46C to ECC6 UNICODE, we realize that if we sent a file type CSV with header, it returns the following message:

 

 

The transfer was terminated. However, content errors occurred

Message no. GD074

 

My question is: should the file sent have header or not?

 

Thanks is advance for your help.

 

Best Regards,

 

Leonardo


Automatically Save PDF Form

$
0
0

Hi

I have a pdf form that read the employee details from the PA tables.

Usualy the pdf form displays in preview but now i have a request to automaticaly save the file in a folder.

 

The user will have a screen with a button "Generate Employee Form" when the user will press this button the system will generate the from in the backround and save a pdf file in the target folder.

 

Is there a way to do that ?

 

 

Thanks

start-of-selection being triggered on Enter

$
0
0


I am having a problem with the start-of-selection being triggered with the enter key after I edited the selections and change a value.  Specifically, I have 3 fields on the selection screen.  I  enter the value for the first field and hit Execute.  This triggers AT SELECTION-SCREEN and calls my subroutine to edit the fields.  Fields 2 and 3 are blank.  The edit code will give an error if either is blank.  So, if I enter a value in the 3rd field and press enter, sy-ucomm is blank and the start-of-selection is hit and the program executes. If I enter any or all of the fields and hit enter without first hitting execute, the selection screen remains and the program does call the edit subroutine and the program does not start.  After I hit execute, it will call the edit routine  from within the At Selection-Screen and the program will execute

Unusual occurance of No measurement unit is assigned to ISO-Code

$
0
0


We are getting the error "No measurement unit is assigned to ISO-Code xxx" for various units of measure when we are processing BOMMAT IDOC's at sporadic intervals.  I've already gone through the various discussions on this error ( like checking CUNI ) and there are some unusual aspects to this which I think may be causing it.

 

I should say what environment we are in - It's SAP version 640 ( ECC 5 ) on SP 27 for ABAP and BASIS and SP 79 for the application pieces.  It's a very mature system that has been around over 10+ years.

 

First of all, we are generating the BOMMAT IDOC itself in some cases as opposed to letting change pointers do it.  We have a custom field in MARA that tells us if a material is a BOM that is to be transferred.  If this field is marked as a "B", then we get the list of those materials and create BOMMAT transactions out of them and run each one at a time.  The reason for doing it this way is that we don't want ALL bom's to go, just the ones we have marked - thus the reason for doing it.  The other reason for doing it this way is that we are modifying the IDOC to tell the processor to send ALL parts of the BOM, not just the parts that changed because the receiver can't handle updates on just the pieces.  So in essence, here is how we process BOM's in program ZRBDMIDOC:

 

     " Get all the BOMMAT's to process

     Get everything from BDCPV into an internal table for BOM's ( yes we know it's a view )

 

     " Process each BOMMAT we want to process

     Loop at the above internal table

          get MAST information we need

          Append a record into an internal table called lt_bom for each entry in MAST we found (

          create an entry into an internal table called lt_bdcps for what we processed

     ENDLOOP

     Update table BDCPS from entries in internal table lt_bdcps

 

     " Commit changes and wait for them to finish

     COMMIT WORK AND WAIT

 

     " Submit each BOMMAT to be processed separately

     LOOP AT lt_bom

          build table it_rspar and fill values into structure calle rspar for the BOM

          SUBMIT rbdsebom WITH SELECTION-TABLE it_rspar

     ENDLOOP

 

We also have a custom version of RBDMIDOC that processes IDOC's in chunks of 5000 IDOC's at once because it was running out of memory due to the system load.  So if more changes are needed, it won't be that big a deal as we've already created custom versions of RBDMIDOC, RBDMIDOC2, and RBDMIDOX.

 

So most of the time this works, but sometimes we get the following messages ( and they always appears this way and in this order )

 

0 change poi. deleted before processing: 0 inbound events checked     Message no. 6M002

No measurement unit is assigned to ISO-Code ST     Message no. BM034

 

It's not always the same UOM, it all depends on the BOMMAT it's working on.  Message 6M002 always shows up that way no matter what.

 

What I strongly suspect is that we are running into a timing problem where the program is trying to run an IDOC that is not yet fully built and it doesn't have the right data in it and it them bombs out.  Because this is an A error, I can't trap it and our custom parent is dying because of it.  I suppose I could put a TRY block on it and capture the error that way, that would work as well - the error is coming from rbdsebom.

 

I believe I've described this fully, but if someone needs more information let me know - this issue has been going on for 2 years.

Check overlap of dates along with time component

$
0
0

Hi all,

 

Is there a FM to check if a group of date and time overlaps?

 

For example: If have start date, start time and end date and end time for one date and time range. Now there is one more date and time range(start date, start time and end date and end time) which i need to check if it overlaps the first.

 

Any ideas??

 

Thanks

Kaeyur Rudra

Function Module WS_DELIVERY_UPDATE_2 not updateing Picking/putaway confirmation

$
0
0

Hi Experts,

 

I'm using FM 'WS_DELIVERY_UPDATE_2' to process picking on a modbile scanner.

 

Everything is working well except the "Picking/Putaway confirmation (LEDLVSTATDISPITEM-KOQUA)' Status is not getting updated and remains on 'B'.

 

My Code:

 

wa_vbkok-vbeln_vl = zsdmob_in01m-vbeln.      "outbound delivery no
wa_vbkok-vbtyp_vl = 'J'.
wa_vbkok-kodat = sy-datum.
wa_vbkok-kouhr = sy-uzeit.
wa_vbkok-kzpod = 'V'.

 

* update picking for line item
  CALL FUNCTION 'WS_DELIVERY_UPDATE_2'
    EXPORTING
      vbkok_wa                           = wa_vbkok
      COMMIT                             = 'X'
      delivery                           = zsdmob_in01m-vbeln
      update_picking                     = 'X'
      SYNCHRON                           = 'X'
   IMPORTING
     ef_error_any                       = wa_error
     ef_error_in_item_deletion          = w_error_in_item_deletion
     ef_error_in_pod_update             = w_error_in_pod_update
     ef_error_in_interface              = w_error_in_interface
     ef_error_in_goods_issue            = w_error_in_goods_issue
     ef_error_in_final_check            = w_error_in_final_check
     ef_error_partner_update            = w_error_partner_update
     ef_error_sernr_update              = w_error_sernr_update
   TABLES
     vbpok_tab                          = t_vbpok.

 

When I want to do Processes Goods Issue I get the Error "Picking request not yet confirmed".

 

Please avdise on any help to get  this sorted.

 

Regards

Ian

I am getting problem with internal table & work area declaration.

$
0
0

I am working with 'makt' table ..with the table makt i need to work with styles attributes ..so i declared like this

 

TYPES : BEGIN OF ty_makt,

         matnr TYPE makt-matnr,

         spras TYPE makt-spras,

         maktx TYPE makt-maktx,

         maktg TYPE makt-maktg,

         celltab TYPE lvc_t_styl,

       END OF ty_makt.

DATA : i_makt TYPE TABLE OF ty_makt.

DATA : wa_makt TYPE ty_makt .


    But end of program i need to update dbtable "makt"...i am getting problem with internal table & work area declaration.

i think makt table fields mapping and internal table/work area mapping is not correct. so please help me to get out from this.

Copy a program Query to a Z Program

$
0
0

Hello SCN,

 

¿Someone knows please what is the best secure way to copy a programa query to my z report?

 

From a Query I have the name of the program, now I want this program be copied into my zprogram in order to reuse the query.

 

 

Thanks so much.


Issue with job and its spool

$
0
0

Hi All,

      I have an issue with one of my requirement.

 

I have a calling program which contains a submit program

 

PROGRAM1

      SUBMIT PROGRAM2.....

      Display ALV(creates spool 1,if set in back ground)

 

PROGRAM2

      DISPLAY ALV(creates spool 2,if program 1 is ran in background)

 

 

I am submitting a job with program 1 and spool parameters given.

This creates 2 spools(1 for program1, and the other for program 2)

 

Requirement is Whatever spool parameters i define for job of program1,same spool parameters needs to be applied for spool of program2.

 

Issue is: Even though I have hard coded the spool parameters(same as defined in job) for program2 in submit program2 using spool....,I am getting different spool parameters.

 

For instance, Program 1 is set in background with printer NULL spool1 is generated with NULL printer whereas spool2 is generated with LOCL printer

 

How do I get same spool parameters for the both spools genrated?(Spool1 and spool2 with printers as NULL)

 

Let me know if the question is not clear.

Awaiting for you replies....

 

 

Thanks,

Madan

Suppress dialog after CTRL P

$
0
0

Hi

 

I am using  REUSE_ALV_GRID_DISPLAY to display ALV screen  and ALV display has standard Print button. So When I click on CTRL- P the Pop up comes for the print . I want to supress this Pop up.

 

The print should not go before pressing the CTRL-P .

 

 

Any suggestions.

Authorization Check

$
0
0

Hi All,

 

I have a requirement where I need to update the authorization check for the FB02 T code...

task is :

Insert authority check prior to calling Transactions or program

 

Program is ( a part where i need to update the code):

 

set parameter if 'BLN' field accrual_belnr

set parameter if 'BUK' field accrual_bukrs

set parameter if 'GJR' field accrual_gjahr

call transaction 'FB02' and skip first screen.   (Here I need to update the Auth check)

 

I have written a Authorization check code like:

 

AUTHORITY-CHECK OBJECT 'S_FB02'

           ID 'belnr' FIELD accrual_belnr

           ID 'gjahr' FIELD accrual_gjahr

           ID 'bukrs' FIELD accrual_bukrs.

        IF  sy-subrc = 0.

        MESSAGE 'No authorization' TYPE 'E'.

ELSE.

  MESSAGE 'Congrats! You are authorized' TYPE 'S'.

ENDIF.

 

Is my code is correct or do i need to make any changes??  Wht is the existing tcode call?

 

kindly help with this.

 

Regards,

Kiran

'Create' Push button is not working in BDC and LSMW while uploading G/L master data

$
0
0

Hello Experts:

 

I am facing the following problem:

While uploading G/L master data with the BDC program, 'create' push button is not working  even after executing following lines.

 

PERFORM BDC_DYNPRO      USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.

PERFORM BDC_FIELD       USING 'BDC_OKCODE'

                               '=ACC_CRE'.

 

Create G/L account  screen is not coming in BDC. Please suggest me what to do.

 

Thanks !!

Transport a Query to Develop Environment

$
0
0

Hello,

 

¿Someone knows please how to transport a single Query?, Consider that the infoset and usergroup are already created in Develop Environment and exists other querys in this infoset.

 

Thanks so much.

Finding Duplicate Material

$
0
0

We have found a few different materials with the same BOM.
As we find them, we make one of them obsolete. We probably have quite a few that we don't know about.

Is there a standard SAP report that would give me a list of all materials that contains the same BOM?

CS14 will not work (unless I don't know how to use it)

 

Thank you

Sending email with any type of attachment

$
0
0


Hi gurus,

 

 

I want to send an email with attachments from Web UI. i was attaching attachment from user desktop, i was using oop's  cl_bcs add_attachment method in the Back end ECC i created one function module for email sending. when i checked the mail in sost it was coming with attachment, and for the contents if it is text file contents are coming properly, but for other formats as PDF, DOC   the contents are not coming properly, file cannot opened. some special characters are coming. i tried using all conversion method using FM SCMS_STRING_TO_XSTRING, SCMS_XSTRING_TO_BINARY.

Please do the needfull

 

Thanks & Regards,

Dharani


BAdI enhancement definition and implementation

$
0
0

Objective

 

The objective of this document is to show how to crate a BAdI from its definition to its implementation and how to use it as an

enhancement through a sample program using the flight model tables.

 

We´ll create a BAdI definition, its implementation class and a report to be enhanced.

This BAdI enhancement allows the user in a report to double-click a row from a list of flights and access its detailed list.

 

 

BAdI Definition

 

Create the following interface with the method 'lineselection' with the corresponding parameters:


 

 

Then create the classic BAdI Definition in SE18 according to the screen below:

 

 

 

 

BAdI Implementation

 

In SE19 create the BAdI implementation as follows:

 

 

Assign the class name ZCL_IM_BC425_IM and the code for lineselection method:


 

 

Activate your implementation.

 

 

Report

 

Finally, use the code below for creating the report:


REPORT  ZSAPBC425_BADI.

DATA: wa_spfli TYPE spfli,
       it_spfli TYPE TABLE OF spfli WITH KEY carrid connid.

*reference variable for BAdI
DATA: exit_ref TYPE REF TO zif_ex_bc425.

*selection screen
SELECTION-SCREEN BEGIN OF BLOCK carrier WITH FRAME TITLE text-car.
   SELECT-OPTIONS: so_carr FOR wa_spfli-carrid.
SELECTION-SCREEN END OF BLOCK carrier.

START-OF-SELECTION.

CALL METHOD cl_exithandler=>get_instance
   CHANGING
     instance = exit_ref.

SELECT *
   FROM spfli
   INTO CORRESPONDING FIELDS OF TABLE it_spfli
   WHERE carrid IN so_carr.

END-OF-SELECTION.

   LOOP AT it_spfli INTO wa_spfli.

     WRITE: / wa_spfli-carrid,
              wa_spfli-connid,
              wa_spfli-countryfr,
              wa_spfli-cityfrom,
              wa_spfli-countryto,
              wa_spfli-cityto,
              wa_spfli-deptime,
              wa_spfli-arrtime.

     HIDE: wa_spfli-carrid,
           wa_spfli-connid.

     ENDLOOP.

AT LINE-SELECTION.

   CHECK NOT wa_spfli-carrid IS INITIAL.

   CALL METHOD exit_ref->lineselection
       EXPORTING
         i_carrid = wa_spfli-carrid
         i_connid = wa_spfli-connid.

   CLEAR wa_spfli.

 

 

Results


 

Inbound IDOC Posting

$
0
0

I am developing a function module in ECC that will be used to post inbound IDOC for customer creation DEBMAS07

 

The logic is as follows -

 

The function receives an IDOC structure

It then invokes function module 'IDOC_INPUT_DEBITOR'

 

IDOC_INPUT_DEBITOR takes care of creating a new customer in table KNA1. But I was expecting IDOC_INPUT_DEBITOR to also handle the IDOC posting. This way I can go to WE02 and see a new IDOC record. What am I missing? Is there some more code I need to write after the function module call?

 

Thank you.

 

 

* IDOC structures for using ALE

     data       lc_no_display         type bdwfap_par-inputmethd value ' '.

 

     data       lt_idoc_control       type standard table of edidc.

     data       ls_idoc_control       type edidc.

     data       lt_idoc_data          type standard table of edidd.

     data       lt_idoc_data_knvi     type standard table of edidd.

     data       lt_idoc_status        type standard table of bdidocstat.

     data       ls_idoc_status        type bdidocstat.

     data       lt_return_variables   type standard table of bdwfretvar.

     data       lt_serialization_info type standard table of bdi_ser.

     data       lv_workflow_result    type bdwf_param-result.

 

     data       pi_idoctyp            type edi_iapi00-idoctyp.

     data       pt_segments           type standard table of edi_iapi11.

     data       lw_segments           type edi_iapi11.

 

     data       ls_idoc_data          type edidd.

     data       ls_e1kna1m            type  zdebmas07_e1kna1m.

     data       e1kna1m               type e1kna1m.

 

 

 

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

*** CONTROL DATA

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

     ls_idoc_control-mandt  = input-idoc-edi_dc40-mandt.

     ls_idoc_control-status = input-idoc-edi_dc40-status.

     ls_idoc_control-doctyp = input-idoc-edi_dc40-idoctyp.

     ls_idoc_control-direct = input-idoc-edi_dc40-outmod.

     ls_idoc_control-rcvprt = input-idoc-edi_dc40-rcvprt.

     ls_idoc_control-rcvprn = input-idoc-edi_dc40-rcvprn.

     ls_idoc_control-stdmes = input-idoc-edi_dc40-stdmes.

     ls_idoc_control-outmod = input-idoc-edi_dc40-outmod.

     ls_idoc_control-sndpor = input-idoc-edi_dc40-sndpor.

     ls_idoc_control-sndprt = input-idoc-edi_dc40-sndprt.

     ls_idoc_control-sndprn = input-idoc-edi_dc40-sndprn.

     ls_idoc_control-mestyp = input-idoc-edi_dc40-mestyp.

     ls_idoc_control-idoctp = input-idoc-edi_dc40-idoctyp.

     append ls_idoc_control to lt_idoc_control.

 

 

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

*** READ SEGMENTS

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

     pi_idoctyp = ls_idoc_control-idoctp.

     call function 'IDOCTYPE_READ_COMPLETE'

       exporting

         pi_idoctyp         = pi_idoctyp

       tables

         pt_segments        = pt_segments

       exceptions

         object_unknown     = 1

         segment_unknown    = 2

         relation_not_found = 3

         others             = 4.

 

     loop at pt_segments into lw_segments.

       case lw_segments-segmenttyp.

         when 'E1KNA1M'.

           ls_idoc_data-segnam = 'E1KNA1M'.

           ls_idoc_data-mandt  = sy-mandt.

           ls_idoc_data-segnum = lw_segments-nr.

           ls_idoc_data-psgnum = lw_segments-parpno.

           ls_e1kna1m          = input-idoc-e1kna1m.

           move-corresponding ls_e1kna1m to e1kna1m.

           move e1kna1m to ls_idoc_data-sdata.

           append ls_idoc_data to lt_idoc_data.

           exit.

       endcase.

     endloop.

 

 

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

*** IDOC INPUT CALL FUNCTION

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

     data: response type zsi_create_customer_is_res_tab.

     data: response_lwa type zsi_create_customer_is_respons.

     data: lwa_error_message type string.

 

 

     call function 'IDOC_INPUT_DEBITOR'

       exporting

         input_method          = lc_no_display

         mass_processing       = space

       importing

         workflow_result       = lv_workflow_result

       tables

         idoc_contrl           = lt_idoc_control

         idoc_data             = lt_idoc_data

         idoc_status           = lt_idoc_status

         return_variables      = lt_return_variables

         serialization_info    = lt_serialization_info

       exceptions

         wrong_function_called = 1

others                = 2.

Report always shows default variant

$
0
0

Hello,

 

I've got a report where we can choose a variant in the selection screen.

 

SELECTION-SCREEN BEGIN OF BLOCK SEL2 WITH FRAME TITLE TEXT-002.

PARAMETERS p_layout TYPE slis_vari.

SELECTION-SCREEN END OF BLOCK SEL2.

 

I've got it setup so that when the user runs the report, the field p_layout is filled with his default variant or if he has none it's empty.

 

My problem is when the field is empty the result ALV is always shown with the default variant.

 

For example:

User has 2 variants - SAV1 and SAV2 (default).

User enters selection screen and p_layout is filled with SAV2.

Scenario 1:

User presses F8 and the ALV is shown with the variant SAV2

 

Scenario 2:

User changes p_layout to SAV1 and presses F8. ALV is shown with SAV1 variant

 

Scenario 3:

User emptys p_layout (p_layout IS INITIAL), presses F8 and ALV is shown with SAV2 variant - the default one

 

What can I do so that when p_layout IS INITIAL the ALV shows all the columns?

 

This is how I define the layout:

       gr_layout = gr_alv->get_layout( ).

       MOVE sy-repid TO gs_layout_key-report.

       gr_layout->set_key( gs_layout_key ).

       gr_layout->set_save_restriction( if_salv_c_layout=>restrict_none ).

       gr_layout->set_default( 'X' ).

       gr_layout->set_initial_layout( p_layout ).

 

F4 help for p_layout:

   ls_layout_key-report = sy-repid.

   ls_layout_info = cl_salv_layout_service=>f4_layouts( ls_layout_key ).

   p_layout = ls_layout_info-layout.


Initialization of p_layout:

   gs_variant-report = sy-repid.

   CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'

     EXPORTING

       I_SAVE        = 'A'

     CHANGING

       CS_VARIANT    = gs_variant

     EXCEPTIONS

       WRONG_INPUT   = 1

       NOT_FOUND     = 2

       PROGRAM_ERROR = 3

       OTHERS        = 4.

   IF sy-subrc = 2 OR sy-subrc = 0.

     p_layout = gs_variant-variant.

   ELSE.

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

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

   ENDIF.

the sy-subrc = 2 is there to prevent error if user has no layouts => p_layout stays empty


Thank you in advance!

classical report using write statement after alv

$
0
0

Hi ,

 

I have checkbox in my reuse alv list .when I press execute button ,it should take me to another classical report done using write statement .I am finding the ALV after the write statement .I have tried LEAVE TO LIST PROCESSING AND RETURN 0 before and after the write statement ,still the alv is coming .How to avoid the alv to appear after write statements .

Matchcode object i_status_sys and i_status_usr

$
0
0

Hi guys,

 

I need help regarding matchcode object.

I copied a program from earlier version of SAP (R/3) to ECC6.

In that program there is a selection screen field with matchcode object i_status_sys and i_status_usr. I have tried this in R/3 and it works fine, but it doesn't work in ECC6.

 

Anybody knows the new version of i_status_sys and i_status_usr?

Thanks!

 

Sam.

Viewing all 8332 articles
Browse latest View live


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