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

CG3Z pb with uploading a .txt file in ASCII

$
0
0

Hi,

 

I am trying to upload a .txt file with CG3Z and I need to use de ASCII transfer format.

 

But I have this message : '' File cannot be uploaded with transfer format 'ASC' "

 

However, the transfer format 'ASC' works with a .EXP file, but it doesn't work with a .TXT file.

 

 

Do you have an idea why a .TXT file can't be uploaded in 'ASC' ?

 

Thanks for your help,

 

 

Jo


Selection Screen hangs/stuck when returning, maybe because of char1024 field

$
0
0

Hi,

In my selection-screen program, I use method CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG. It opens a pop-up screen to select a desired file, and puts the value into the parameter P_FILENM (char1024). After I select the file and close the pop-up screen, It takes about 2-3 seconds for the selection-screen parameter to refresh itself with the filename inside P_FILENM text-box. After execution, the program displays the file's contents in an SALV table. When I go back to the selection-screen using method GO_SALV_TABLE->CLOSE_SCREEN, it takes another 3-4 seconds during which the screen hangs, I can see the empty screen with the execution button but no parameters, and only then they appear and the screen becomes available.

 

My question is: why are those delays happening? Maybe it is related to the char1024 field? How can I prevent them from delaying the program's operation?

 

Thank you!

 

--------------------------------------------

 

SELECTION-SCREEN BEGIN OF LINE.

PARAMETER p_filenm TYPE zfilename.   " Filename Upload textbox - ZFILENAME is based on CHAR1024

SELECTION-SCREEN END OF LINE.

 

--------------------------------------------

 

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_filenm.

  PERFORM file_open_dialog CHANGING gv_file_name.

  p_filenm = gv_file_name.

 

START-OF-SELECTION.

    " get data

 

......

 

    PERFORM setup_salv CHANGING gt_data[]

                                go_salv_table

                                go_salv_events

                                go_salv_events_handler

                                go_salv_display

                                go_salv_sorts

                                go_salv_columns

                                go_salv_column

                                go_salv_functions.

 

    go_salv_table->display( ).

    go_salv_table->close_screen( ).

 

--------------------------------------------

 

FORM file_open_dialog CHANGING ev_file_name TYPE zfilename.

 

  DATA: lt_file_tab TYPE filetable,

        ls_file     LIKE LINE OF lt_file_tab[].

 

  gv_report_title = text-001.    " Choose a file

 

  " Opening the File Selection dialog:

  CALL METHOD cl_gui_frontend_services=>file_open_dialog

    EXPORTING

      window_title            = gv_report_title

*     DEFAULT_EXTENSION       =

*     DEFAULT_FILENAME        =

      file_filter             = gc_filetypes_filter

*     WITH_ENCODING           =

*     INITIAL_DIRECTORY       =

*     MULTISELECTION          =

    CHANGING

      file_table              = lt_file_tab[]

      rc                      = gv_rc

*     USER_ACTION             =

*     FILE_ENCODING           =

    EXCEPTIONS

      file_open_dialog_failed = 1

      cntl_error              = 2

      error_no_gui            = 3

      not_supported_by_gui    = 4

      OTHERS                  = 5.

 

  IF sy-subrc <> 0.

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

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

  ENDIF.

 

  " Getting the selected file:

  READ TABLE lt_file_tab[]

    INTO ls_file INDEX 1.

 

  " Setting the selected file as the parameter:

  ev_file_name = ls_file-filename.

 

ENDFORM.

In inspection plan change

$
0
0

Hi

 

i am using the BAPI: BAPI_INSPECTION PLAN_CREATE. by using this Bapi i am able create the PLAN.But by using this BAPI i am not able to Change the PLAN Data. Please help me on this.

Express document update was teminated(document was saved but not update account document)

$
0
0

Hi All,

 

When I am trying to create invoice through vf01 it is showing error message like Express document update was terminated. It is not update in vf03 vbrk table. In sm13 is showing error: RV_message_update,

 

class: 8i message is : 301.

 

Document not found. excise document update not done or document was archived. In abap is is showing dump in standatd sap.please suggest me on this.

Problem when adding new items and conditions with BAPI_SALESORDER_CHANGE

$
0
0

Hi,

 

I'm trying to use bapi BAPI_SALESORDER_CHANGE to update a sale order, by adding new items with conditions.

I tried differents way, differents values, but i already the same problem : Error message VH_BAPI     050 - Price determination error

 

Here is parts of my code (lt_poste and lt_condition are internal table containing new items and new condition for my order)

 

  CLEAR : ls_headerx, ls_bapisdls.  ls_headerx-updateflag   = 'U'.      " Update code  ls_bapisdls-cond_handl  = 'X'.     " Flag to maintain conditions

*== Loop on my new items
  LOOP AT lt_postes INTO ls_postes.

*== Item datas
    CLEAR : ls_items, ls_itemsx.    ls_items-itm_number       = ls_postes-posnr    ls_itemsx-itm_number     = ls_postes-posnr.    ls_itemsx-updateflag      = 'I'.                          " Creation code    ls_items-item_categ          = ls_postes-pstyv.       ls_itemsx-item_categ        = 'X'.    ls_items-material               = ls_postes-matnr.    ls_itemsx-material             = 'X'.    ls_items-short_text           = ls_postes-arktx.    ls_itemsx-short_text         = 'X'.    ls_items-plant                    = ls_postes-werks.           ls_itemsx-plant                  = 'X'.    ls_items-mat_pr_grp         = ls_postes-kondm.       ls_itemsx-mat_pr_grp       = 'X'.    ls_items-tax_class1          = ls_postes-taxm1.         ls_itemsx-tax_class1        = 'X'.    ls_items-ex_rate_fi           = ls_postes-kurrf.      ls_itemsx-ex_rate_fi         = 'X'.    ls_items-exch_rate_fi_v   = ls_postes-kurrf.       ls_itemsx-exch_rate_fi_v  = 'X'.    ls_items-po_itm_no            = ls_postes-posex.              ls_itemsx-po_itm_no          = 'X'.    ls_items-reason_rej           = ls_postes-abgru.             ls_itemsx-reason_rej         = 'X'.    SELECT SINGLE bstkd bstdk FROM vbkd INTO (ls_items-purch_no_c , ls_items-purch_date)    WHERE vbeln = me->s_vbak-vbeln    AND   posnr = ls_postes-posnr.    IF sy-subrc = 0.      ls_itemsx-purch_date = 'X'.      ls_itemsx-purch_no_c = 'X'.    ENDIF.    CLEAR ls_items-wbs_elem.    CALL FUNCTION 'CONVERSION_EXIT_ABPSP_OUTPUT'      EXPORTING        input  = ls_postes-ps_psp_pnr      IMPORTING        output = ls_items-wbs_elem.    ls_itemsx-wbs_elem        = 'X'.    APPEND ls_items   TO lt_items.    APPEND ls_itemsx  TO lt_itemsx.

*== Condition datas
    LOOP AT lt_condition INTO ls_condition.      CLEAR : ls_bapicond, ls_bapicondx.      ls_bapicond-itm_number      = ls_postes-posnr.      ls_bapicondx-itm_number    = ls_postes-posnr.      ls_bapicond-cond_type        = ls_condition-kschl.      ls_bapicondx-cond_type      = ls_condition-kschl.      ls_bapicond-cond_value      = ls_condition-kbetr / 10.      ls_bapicondx-cond_value    = c_x.      CLEAR lv_krech.      SELECT SINGLE krech FROM t685a INTO lv_krech        WHERE kappl = 'V'        AND   kschl = ls_condition-kschl.      ls_bapicond-calctypcon    = lv_krech.      IF lv_krech = 'C'. "Pricing condition        ls_bapicond-currency    = 'EUR'.        ls_bapicondx-currency   = c_x.      ENDIF.      ls_bapicond-cond_updat    = 'I'      ls_bapicondx-updateflag    = 'I'      APPEND ls_bapicond  TO lt_bapicond.      APPEND ls_bapicondx TO lt_bapicondx.    ENDLOOP.
ENDLOOP

*== BAPI Execution
  CALL FUNCTION 'BAPI_SALESORDER_CHANGE'    EXPORTING      salesdocument    = me->s_vbak-vbeln      order_header_inx = ls_headerx      logic_switch         = ls_bapisdls    TABLES      return                   = lt_bapiret2      order_item_in       = lt_items      order_item_inx     = lt_itemsx      conditions_in        = lt_bapicond      conditions_inx      = lt_bapicondx.  CLEAR ls_bapiret2.  READ TABLE lt_bapiret2 INTO ls_bapiret2 WITH KEY type = 'E'.  IF sy-subrc <> 0.    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.  ENDIF.

 

 

So i'm getting this an error message, indicate that's it's impossible to determine price.

ie : 000010 : Processing terminated; pricing error ( KOMP-FXMSG = 801 )

 

I tried to update other value but nothing change.

 

I have only 2 condition to add to my item : PR00 and ZMAR (% type)

So here are the other field in condition table that a filled but, i also have the same message :

 

 

APPLICATIO  = V

CALCTYPCON = A (ZMAR) or B (PR00)

STAT_CON = X (only for ZMAR)

CONDORIGIN  = C

GROUPCOND = X (only for ZMAR)

CONDCNTRL  = C

CONDCLASS  = A (ZMAR) OR C (PR00)

CONDCHAMAN  = X

 

Is there any field that i could forgot ? Do you know where i could be wrong ?

 

Many thanks in advance for any answer.

BAPI to update Production Order field AFPO-ANZSN

$
0
0

Hi there,

 

We are using the FM SERNR_ADD_TO_PP to add serial numbers to a Production Order using an RF scanning transaction.

All works well, the only issue is that the field AFPO-ANZSN (number of serial numbers) does not get updated.

 

I tried a few FMs suggested in forum to update this field, so far without success (CO_BI_AFPO_UPD does not work)

Can anyone please give a suggestion on how to successfully update this field?

 

Thanks,

David

Printing QR-Code SAP smartforms

$
0
0

Hi,

 

I have a big problem when I Print QR-Code using smartforms and I can't think how to solve this.

 

I Applied these notes:

 

  • 2029824 - Support for QR code and data matrix bar code (ABAP part)
  • 2030263 - Support for QR Code 2005 Barcode in SAPscript and Smart Forms
  • 2001392 - Support for Datamatrix ECC200 Barcode in SAPscript and Smart Forms
  • 2029589 - Support for QR code and data matrix bar code (kernel part)

 

After I do some test in SE73. Like I saw here Printing QR-Code barcodes in SAP smartforms

 

In the test everything is OK. QR-Code was printed correctly and I could scan using my mobile APP.

 

But here is the BIG problem, I need to print the QR-Code insede the smartforms, but this QR-Code has more than 255 characters and when I print the QR-Code and scan I just get the 255 characters and Smartforms cut the rest of the string.

 

I know this is a smartforms limitation, but there is one solution tu solve this using the standard QR-Code Printer?


PS: I copy the program RSPO0031 and pass the entire string and it's print everything. Lookin for program I figure that it's get some tipe of image and convert to OTF, but i can't find a way to save this image. If it's possible I could use this imagem inside the smartforms.

Create Transfer Order (WM) for Delivery

$
0
0

Hi experts,

I am using the FM 'L_TO_CREATE_DN' to create a transfer order for a delivery.

 

My requirement is that the user will enter the delivery number, storage unit and the quantity on the screen and a TO must be created for it.

 

The problem I am facing is that multiple TOs are getting created with this FM. I need to create a TO only peraining to the Storage Unit (SU) entered by the user.

 

Please let me know how can I achieve this.

 

Thanks,

Dawood.


Add Custom Field in MIRO without accesskey

$
0
0

Hi Friends,

 

My requirement is to add custom field in MIRO in PO reference tab(Before purchase order column) without access key. Kindly find the below screen shot.

 

MIro.jpg

Thanks with Regards,

Vallamuthu M.

userexit for update RESB when save Purchase Orders

$
0
0

Hello;

     When I create a purchase order using Tcode "ME21N", if i choose the item cat. as “L”, which means subcontracting.

     The sub items coming form the item's BOM  will be saved in transparent table "RESB",;

     Is it possible to update the information to be saved into RESB when saving the purchase order? Such as quality and batch.

 

     I have checked this link: User exit for component data in ME21n/ME22n | SCN

     I set some break points in the programs "MM06EFLB_MDPM_MAINTAIN" and "EXIT_SAPMM06E_012", which are mentioned in the link.

      But when I saved a purchase order, the program would not stop at the break points.

 

    Best Regards!

Setting the selection on the double-click event of ALV grid

$
0
0

Hi,

 

I have a requirement that I am working on and looking for some pointers for one of the issues that I am facing now.

 

Requirement :

To build a parent-child relationship between two sap gui screens.

The parent screen is displaying an ALV grid (using cl_gui_alv_grid class) .

On Double-clicking on a particular record in the ALV , the corresponding details are displayed  in the child screen.

The double click is handled(method)by a non-local class.

This is modeled and is working well.

 

Issue :

When I double click on any specific ALV record, the details are displayed correctly(below) in the

child screen but the ALV record is not highligted/selected in the ALV grid (so this is confusing/no information for the user).

 

I tried the following :

get_selected_nodes and set_selected_nodes methods.

cl_gui_cfw=>flush

refresh_table_display .

 

The double-clicked record is not highlighted.  

 

Is there anything missing ? I have gone through some of the other blogs as well , a double-click is what is required .


Regards,

Abhay


[Note : The screens are configured using BDT framework , but the that should not be a problem as the PBO is getting

called again ]

Replace #(hex value) with space

$
0
0

Hello,

 

I have a program which uploads the text from excel.

In excel, if one cell have multiple lines (separated by Alt + enter) , the program separates them with '#' .

 

I know the '#' is a hexadecimal value, but how could i replace this value with space ?

when i checked the hex value of '#' in debugger, it has the length of more than 2000.

 

Please suggest how i can replace '#' with space.

 

Thanks for your help.

BAPI_INCOMINGINVOICE_CREATE for Service master

$
0
0

Hello expert,

 

I am just wondering , is it possible to create invoice for contract/agreement which doesn't have entry sheet

 

In MIRO transaction, I can directly create invoice using contract with service masters. but no luck with bapi.

 

My contract in ME33k has GR based flag and SRV based flag set.

 

Thanks,

CK

from BAPISDORDER_GETDETAILEDLIST to BAPI_SALESORDER_CHANGE

$
0
0

Hello,

 

I need to use both BAPIs to update some Sales Orders' positions from a report.

 

I cannot use 'BAPI_SALESORDER_CHANGE' alone, because the field I need to change (Item category -> PSTYV) is blocked in 'VA02' transaction due to customizing. So, I will have to get all positions with 'BAPISDORDER_GETDETAILEDLIST', delete them with a first call to 'BAPI_SALESORDER_CHANGE' and create them again, with the small change, with a second call.

 

The problem is that the item structure of the table parameters in the two BAPIs is different (one is named 'BAPISDIT' and the other 'BAPISDITM') and, even the names of the fields (and their related data elements!!!) are different too. Therefore I cannot perform a "move-corresponding", nor use some RTTS dynamic progamming (relating them by data type).

 

I have found some 'MAP2E*' functions related to each one, but none for both (to act as an interface "bridge").

 

Has anyone faced the same problem?

 

Thanks a lot!,

 

Eloi

Create one or more instance of a class

$
0
0

Hey experts,

I have a question about good abap oo coding.

I have a class (e.g. cl_adjust) which will adjust some attributes of promotions.

 

In my Programm I have do to many things, but at a certain point, due to some Information, I have to adjust a promotion.

Now I will call the class cl_adjust to do that.

 

My Question now is, should I create a new Instance for every promotion (everytime I come to the point, where I have to adjust a promotion) or should I create one Instance of the class and call a method (e.g. cl_adjust->execute( IMPORTING io_promotion = lo_promotion )?

 

I guess, the programm ist faster, if I just create one instance?

 

Thanks in advance and BR,

Sebastian


Line_exists - odd compiler error

$
0
0

I was trying to use line_exists today and ran into an unexpected issue you can see below. When I use line_exists for an if statement expression, it handles the usage correctly. If I try to save the value directly to a boolean variable however, it will fail with the odd "line_exists( expected, not line_exists(" error. Just curious if anybody knew if there was a note out there to address this problem or if this is not allowed usage for line_exists.

 

line_exists annoyance.png

Getting termination message for BAPI_INSPECTIONPLAN_CREATE

$
0
0

Dear Experts,

 

I am trying to create a new group counter using the same task list group through BAPI_INSPECTIONPLAN_CREATE. I have kept all the parameters same except for task list usage and updating the reference operation table with the referenced task list group and the corresponding group counter.After executing the BAPI i get a new group counter for the same task list group. However in the return table i get a termination message stating that ''THE FLAGGED OPERATION IS NOT ALLOWED' with the message type A and ID CPCC_DT. I am not sure that this BAPI supports this kind of operation. If it does it would be great if someone could help me where i might be going wrong so that i may correct myself .

 

Thanks,

Ajinkya

alv to excel report

$
0
0

How to change excel headers when we exporting it from alv to xls

How can i modify the resolution of screens when we worked with wizard builder

$
0
0

Hi,

hope to modify the resolution of this screen

regards.

 

Capture11.PNG

 

 

and this is my program :

 

 

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

*& Report  ZRUN_ZVI

*&

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

*&

*&

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

REPORT ZVI_ASSISTANTALV.

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

*&  Include           ZRUN_WIZARD

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

include zvi_assistantalv_top.

include zvi_assistantalv_f01.

include zvi_assistantalv_o01.

include zvi_assistantalv_i01.

include <wizard>.

 

 

* Creation of wizard definition.

PERFORM wizard_append_def USING :

       'ZVI_ASSISTANTALV' 'Start' 'START_WIZARD',

       'ZVI_ASSISTANTALV' 'Informations sur le programme' 'SHOW_SCREEN_0100'.

* Starting the wizard.

CALL FUNCTION 'SWF_WIZARD_PROCESS'

   EXPORTING

     container_compensation      = 'X'

 

*   PROCESS_LOGGING                   = 'X'

*   ROADMAP                           = 'X'

*  START_COLUMN                      = 2

*  START_ROW                         = 2

*  SIZE                              = ''

*   AMODAL                            = ' '

*   DO_INIT                           = ' '

*   CALLBACK_PROGRAM                  = ' '

* IMPORTING

*   WIZARD_COMPLETE                   =

   TABLES

     definition                  = it_wizdef

   EXCEPTIONS

     operation_cancelled_by_user = 1

     process_in_error            = 2

     OTHERS                      = 3.

 

FORM wizard_append_def using  lv_program TYPE c

                              lv_text TYPE c

                              lv_subroutine TYPE c.

   CLEAR wa_wizdef.

   wa_wizdef-program = lv_program.

   wa_wizdef-text    = lv_text.

   wa_wizdef-form    = lv_subroutine.

   APPEND wa_wizdef TO it_wizdef.

ENDFORM.

 

 

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

*&      Form  start_wizard

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

*  This subroutines starts the wizard.

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

FORM start_wizard TABLES container USING command.

   CLEAR wa_wizard.

   wa_wizard-descobject = 'Z_START'.

   wa_wizard-screen_typ = wizard_screen_start.

   CALL FUNCTION 'SWF_WIZARD_CALL'

     EXPORTING

       wizard_data                 = wa_wizard

       start_column                = 2

       start_row                   = 2

     EXCEPTIONS

       operation_cancelled_by_user = 1

       back                        = 2

       OTHERS                      = 3.

   swf_evaluate command.

 

ENDFORM.

 

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

*&      Form  show_screen_0100

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

*  This subroutine shows the initial input screen of two number

*  in the wizard.

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

FORM show_screen_0100 TABLES container USING command.

   wa_wizard-docuobject = 'Z_INFO'.

   wa_wizard-screen_typ = wizard_screen_normal.

   wa_wizard-subscpool1 = 'ZVI_GENERATORALV'.

   wa_wizard-subscreen1 = '0100'.

 

   CALL FUNCTION 'SWF_WIZARD_CALL'

     EXPORTING

       wizard_data                 = wa_wizard

       start_column                = 2

       start_row                   = 2

     EXCEPTIONS

       operation_cancelled_by_user = 1

       back                        = 2

       OTHERS                      = 3.

   swf_evaluate command.

ENDFORM.

 

FORM end_wizard TABLES container USING command.

   wa_wizard-descobject = 'Z_START'.

   wa_wizard-screen_typ = wizard_screen_end.

 

   CALL FUNCTION 'SWF_WIZARD_CALL'

     EXPORTING

       wizard_data                 = wa_wizard

       start_column                = 2

       start_row                   = 2

     EXCEPTIONS

       operation_cancelled_by_user = 1

       back                        = 2

       OTHERS                      = 3.

   swf_evaluate command.

ENDFORM.                    "end_wizard

ME51N - Customer Data Tab

$
0
0

We have added fields to the customer data tab of Tcode ME51N.  However, the tab height is not tall enough to view all the data without scrolling.

 

Certain tabs (the Service tab) when displayed for data entry enlarges to almost half the screen.  The other tabs, Customer tab included, when displayed for data entry, do not. 

 

Is there a way to increase the height of the customer tab screen at data input to allow all the data to be viewed?

Viewing all 8332 articles
Browse latest View live


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