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

Nametab can not be generated

$
0
0

Hello All,

 

I am facing an error when transporting my request from one system to other.

Could you please help me. This is very urgent !!!

 

 

Thanks in advance,

Sampath


Help for RTTS

$
0
0

Hello Experts,

 

 

I am trying to learn RTTS. I am understanding certain concepts but still there are areas which I need more clarification. The below given link has been advised by many experts to learn RTTS. http://scn.sap.com/thread/1725739. Can anyone explain the correct answer mentioned in this thread.

 

Regards,

 

Marina.

Table field heading not displayed in SM30

$
0
0

Hi,

I have created a  Z table and custom data types, to assign to table fields. But when i see the table in SM30, the fields are displayed as '+' and no field label are being displayed. Even after making entry to the table, when i check in SE11, there also it's not showing Field label, only field names are being shown. Do i need to do any changes? Please help.

 

Regards,

Anubhab

BAdI is internal SAP; implementation in customer namespace not allowed

$
0
0

The BAdi (BADI_SD_TAB_CUST_I) to be implemented is declared as "SAP internal". No customer implementation may be created for this BAdI.

If you wish to create an SAP advance delivery of the BAdI implementation, create this in an enhancement object in the SAP namespace.

can i change the order of the execution of multiple implementations badi

$
0
0

Hi Abap Gurs,

 

Please tell me that can i change the sequence of triggering a badi implementations in multiple badi implementations?

 

How to change the sequence of the triggering the badi implementation if multiple badi implementations exist?

 

Thanks & Regards,

 

Suresh  Reddy

Change validity date of business partner role / Get all roles (also currently invalid ones)

$
0
0
The following code works for the cases
- CRM000 role is not present at all, ever (the code adds it)
- the CRM000 role is valid today (the code changes the valid-from date to 01.01.2000 and valid-to date to 31.12.2000 ... also for any other role; currently it does not check whether the dates need adjustment, but I will implement that check next)
But if failes when
- the CRM000 role is present, but not valid today (because it is not retrieved with BUPA_ROLES_GET_2, but BUPA_ROLE_ADD_2 fails because it is already present).
I have tried all the non-deprecated APIs and BAPIs with BUPA and ROLE in the name that looked like they could solve the problem, but none worked. I am unable to retrieve all BP roles, valid on any days - I can only ever get the roles valid on a specific date (e.g. today).
Header 1

METHOD roles.

  DATA: lt_return         TYPE          bapirettab,
        lt_partnerroles   TYPE TABLE OF bapibus1006_bproles,
        ls_partnerrole    TYPE          bapibus1006_bproles,
        ls_crm000_present TYPE          crmt_boolean.

  FIELD-SYMBOLS: <fs_partnerrole> TYPE bapibus1006_bproles.

  CALL FUNCTION 'BUPA_ROLES_GET_2'
    EXPORTING
      iv_partner      = iv_partner_id
    TABLES
      et_partnerroles = lt_partnerroles
      et_return       = lt_return.

  LOOP AT lt_partnerroles ASSIGNING <fs_partnerrole>.

    IF <fs_partnerrole>-partnerrole = 'CRM000'.
      ls_crm000_present = 'X'.
    ENDIF.

    WRITE: / 'Adjusting valid-from date of role',<fs_partnerrole>-partnerrole,'if necessary'.

    <fs_partnerrole>-valid_from = '20000101'.
    <fs_partnerrole>-valid_to   = '99991231'.

    CLEAR lt_return.

    CALL FUNCTION 'BUPA_ROLE_CHANGE'
      EXPORTING
        iv_partner             = iv_partner_id
        iv_partnerrolecategory = <fs_partnerrole>-partnerrolecategory
*       IV_X_ALL_PARTNERROLES  = ' '
        iv_partnerrole         = <fs_partnerrole>-partnerrole
*       IV_DIFFTYPEVALUE       =
        iv_validfrom           = <fs_partnerrole>-valid_from
        iv_validfrom_x         = 'X'
        iv_validto             = <fs_partnerrole>-valid_to
        iv_validto_x           = 'X'
        iv_x_save              = 'X'
      TABLES
        et_return              = lt_return.

    print_errors( lt_return ).

  ENDLOOP.

  IF ls_crm000_present IS INITIAL.

    WRITE: / 'Adding role CRM000 (Sold-to party)'.

    ls_partnerrole-valid_from          = '20000101'.
    ls_partnerrole-valid_to            = '99991231'.
    ls_partnerrole-partnerrole         = 'CRM000'.
    ls_partnerrole-partnerrolecategory = 'CRM000'.

    CALL FUNCTION 'BUPA_ROLE_ADD_2'
      EXPORTING
        iv_partner             = iv_partner_id
        iv_partnerrolecategory = ls_partnerrole-partnerrolecategory
*       IV_X_ALL_PARTNERROLES  = ' '
        iv_partnerrole         = ls_partnerrole-partnerrole
*       IV_DIFFTYPEVALUE       =
        iv_validfrom           = ls_partnerrole-valid_from
        iv_validto             = ls_partnerrole-valid_to
        iv_x_save              = 'X'
*       IV_CREATE_CP           =
      TABLES
        et_return              = lt_return.

    print_errors( lt_return ).

  ENDIF.

ENDMETHOD.

BUPA_ROLES_GET gets all roles, without validity dates, but it is deprecated. Is it the only way to get all roles? It does not return the validity dates (presumably it stems from a time before roles had validity dates). BUPA_ROLES_READ also does not return the validity dates, there is no BUPA_ROLES_READ_2. So even if I use BUPA_ROLES_GET ... how do I get the validity dates for those roles that are not currently valid?

Upload text data to .xls document

$
0
0

Hi, all. How I can upload text data of function import/export parametrs, description, data element descr, clacc description...

We can see example of abap object text data in transaction se41.

I want to  translate these to another language.    As import parametr i want to send package name.

Confirmed qty change in Sales Order

$
0
0

Hi all!

 

Do you know if exsist a fm or bapi to modify the confirmed quantity in schedule line of a sales order?

I know that exsist BAPI_SALESORDER_CHANGE but I'm not able to modify confirmed qty.

 

My flow consists in two steps:

1. sales order create with confirmed qty = 0;

2. sales order change to modify confirmed qty.

 

Thanks,

Gianluca


in call transaction multiple tcodes

$
0
0

Dear All Abapers,

 

Can i handled multiple tcodes in a call transactions?

 

Thanks & Regards,

Suresh Reddy

screen resolution in bdc

$
0
0

Dear All ABAP Gurus,

 

          Let me know that when i run bdc program in my development server it successfully but in my quality server it failure because of the screen resolution. Please help me with screen shot explainations

 

Thanks & Regards,

Suresh Reddy

SUBRC during mass insertion

$
0
0

Experts,

 

I am inserting multiple records into database as below,

 

INSERT DFKKOP FROM TABLE IT_DFKKOP.

 

Requirement is to capture SY-SUBRC for each record & display it to user(Note: If insert fails, then user wants to take action manually for the same)

 

One option, that I can think of is to insert 1 record at a time in Loop as below,

 

Loop at IT_DFKKOP into WA_DFKKOP.

Insert DFKKOP from WA_DFKKOP.

if sy-subrc ne 0.

----> " ls_errorinfo-message = 'Insertion Failed'.

append ls_errorinfo to lt_errorinfo.

else.

----> " ls_errorinfo-message = 'Inserted Successfully'.

append ls_errorinfo to lt_errorinfo.

endif.

Endloop.

 

Kindly guide me if there is a better efficient option that the above.

 

Regards,

Aspire

A L E A N D I D O C

$
0
0

A L E   A N D   I D O C

ALE:

 

ALE is a SAP Technology to support distributed yet integrated processes across level SAP System.A Distributed process is one in which part of a business process is carried out on one system and part on another.

 

SAP Introduced ALE as its initiative to support a distributed yet integrated environment. ALE allows for efficient and Reliable communication between distributed processes across physically separate sap systems to achieve a distributed yet integrated logical
SAP system.

 

  • Application link enabling (ALE) is a message-based architecture .The data is transferred between various systems in the form of IDocs (data container). It consists of three layers:
  • Application layer
  • Distribution (ALE) layer 
  • Communication layer

 

ALE processes can be broadly defined in two segments.

 

  • Outbound process: The flow of data from sending system to receiver system is called outbound process. The outbound ALE process in SAP sends data to one or more SAP systems.


  • Inbound process :The flow of data into receiver system from sending system is called inbound process

 

Outbound process has two distinct paths for creating IDoc.

    1. With message control.
    2. Directly without message control.

The process involves four steps:

  • Identify the need (triggering mechanism for IDoc creation).
  • Master IDoc generation.
  • Communication IDoc generations.
  • Dispatch Control.

 

Tables Related to ALE & IDOC:

 

EDIDC: Control Records are stored over here.

EDID4: Data Records are stored over here.

EDIDS: Status Records are stored over here.

EDMSG: Message Types are stored over here.

TBDLS: Logical systems are stored over here.

TBDLST: Text for Logical systems is stored over here.

 

 

Logical System:

 

A Logical System (LS) is the representation of an R/3 or external system in SAP R/3 for the distribution of data to and from the R/3 System. In addition to the sender LS, the receiver LS should be created within that R/3 system for receiving R/3 system.

  • An entry for the logical system is created in the table TBDLS.
  • The name can have up to 10 alphanumeric characters
  • The logical system should be unique company wide and should not be used by any other system in the ALE integrated group.

 

IDOC type:

  • An IDoc type defines the syntax of the IDoc data. It tells which segments are found in an IDoc and what fields the segments is made up of.
  • When they are stored to a disk file, the IDocs are simple flat files with lines of text, where the lines are structured into data fields. Their specification is stored in the data dictionary.
  • E.g.: ORDERS05.

 

Message type:

  • Message type represents a specific type of document that is transmitted between two partners. The message type defines the semantic context of an IDoc. Message type is a grouping of IDOC types belonging to similar application. The same IDoc data can be sent under different message types.
  • A message type characterizes the data sent across systems and relates to the structure of the data called an IDoc type.
  • For example, MATMAS is a message type for Material Master, and INVOIC is a message type for an Invoice (Billing Document).

 

Some Important Message Types are:

 

APPLICATION                MESSAGE TYPES

  CUSTOMER                        DEBMAS

  VENDOR                            CREMAS

MATERIAL                          MATMAS

  SALES ORDER                  ORDRSP

  PURCHASE ORDER           ORDERS

 

 

SEGMENT:

 

A Segment defines the format and structure of a data record.

  • A segment in SAP system is technically implemented as three physically separate pieces.
  • Segment type: Segment type is the version independent name of the segment. The standard segment type defined by SAP starts with E1 and the customer defined segment type starts with Z1.
  • Segment definition: Segment Name is the version dependent name. The standard segment name defined by SAP starts with E2 and the customer defined segment type starts with Z2. The last three characters represent the version of the segment. Segment name is automatically assigned by the system from Segment Type.
  • Segment documentation: The standard segment name defined by SAP starts with E3 and the customer defined segment type starts with Z3.

 

   IDOC:

  • An IDOC is an instance of an IDOC type. An IDOC consists of three types of records:

              - Control Record: One control record (Table: EDIDC)

              - Data Record: One or many data records, which contain the application dependent data, for example the material, master data (Table: EDID4).

              - Status Record: One or many status records (Table: EDIDS).

  • We can display information about IDOC types, such as DEBMAS02 and INVOIC01 by executing transaction WE60 or using the following menu path from WEDI: Documentation -> IDoc types.

 

Process of IDOC Creation:

To Create Idoc we need to follow these steps:

 

  • Create Segment           (WE31)
  • Create Idoc Type        (WE30)
  • Create Message Type (WE81)
  • Assign Idoc Type to Message Type (WE82)

 

 

  1. Creating a Segment

  • Go to transaction code WE31
  • Enter the name for your segment type and click on the Create icon
  • Type the short text
  • Enter the variable names and data elements
  • Save it and go back
  • Go to Edit -> Set Release
  • Follow steps to create more number of segments

 

  1. Create IDOC Type

   

    • Go to transaction code WE30
    • Enter the Object Name, select Basic type and click Create icon
    • Select the create new option and enter a description for your basic IDOC type and press enter
    • Select the IDOC Name and click Create icon
    • The system prompts us to enter a segment type and its attributes
    • Choose the appropriate values and press Enter
    • The system transfers the name of the segment type to the IDOC editor.
    • Follow these steps to add more number of segments to Parent or as Parent-child relation
    • Save it and go back
    • Go to Edit -> Set release

     

         3. Create Message Type

    • Go to transaction code WE81
    • Change the details from Display mode to Change mode
    • After selection, the system will give this message “The table is cross-client (see Help for further info)”. Press Enter
    • Click New Entries to create new Message Type
    • Fill details
    • Save it and go back

     

         4. Assign Message Type to IDoc Type

     

    • Go to transaction code WE82
    • Change the details from Display mode to Change mode
    • After selection, the system will give this message “The table is cross-client (see Help for further info)”. Press Enter.
    • Click New Entries to create new Message Type.
    • Fill details
    • Save it and go back

     

    Customer Distribution Model:

     

    The Distribution model (also referred to as ALE-Scenario) is a more or less graphical approach to define the relationship between the participating senders and receivers.

    • The Customer Distribution Model stores data that dictates which message (message types), flow to which Logical Systems. Many messages can flow to one Logical System, and one message can flow to several systems.
    • Use transaction BD64 or the following menu path to maintain the model:
    • Two models cannot distribute the same message between the same set of senders and receivers
    • A customer model is maintained on only one system. It is distributed to other systems for use

     

     

    Ports:

     

    A port is a logical name for an input/output device. It defines the medium in which documents are transferred to the destination system. There are four types of ports

    • tRfc - tRFC port are used for ALE communication. Data is transferred once only.
    • File - The data is transferred in a standard text file format. The receiving system processes the transferred files completely.
    • R/2  - CPIC - Port type for direct access to an R/2 System via the CPI-C protocol.
    • XML - The exchange of IDocs happens via XML files at the operating system level.

    ALE can use all port types to distribute IDocs, while EDI typically uses a file-based port. tRfc and File ports can link to RFC destinations connected to R/3-to-R/3 or TCP/IP.

     

     

    Process codes (WE41):

     

    • Process codes are used in ALE and EDI to identify the function module or API to be invoked for subsequent processing. It is used for filling the IDoc.
    • An inbound interface uses a process code to determine the application module that will process the inbound IDoc to an SAP application object such as a sales (Customer) order (process code — ORDE), Material Master record (MATM), or a shipment (SHIP).
    • An outbound interface uses process codes only in the case of applications that use message control. In this case, the process code identifies the application module that populates the IDoc with application data.
    • Each process code is associated with a message type.

     

     

    Partner Profile:

     

    • When data is exchanged between partners it is important that sender and receiver agree about the exact syntax and semantics of the data to be exchanged. This agreement is called a partner profile. The information defined with the partner profile is:

              - IDoc type and message type as key identifier of the partner profile.

              - Names of sender and receiver to exchange the IDoc information for the respective IDoc message type .

              - Logical port name via which the sender and receiver, respectively will communicate.

              - It also specifies the various components used in an inbound / outbound like process code, the mode in which IDocs are processed (batch versus                immediate), and the person to be notified in case of errors.

    • A partner profile is created for each SAP system you communicate with, and a record exists for each inbound message received from a remote SAP system.

     

    RFC Destination:

     

    It's a unique name for the RFC destination. Use the logical name defined for the remote system. A basic prerequisite for the RFC destination is that the systems should be accessible to each other via TCP/IP or one of the supported network protocols. Several types of RFC destinations are available. ALE uses type R/3 connections for communicating with a remote SAP system.

    • RFC destinations are not transported. It must be maintained on each system manually.
    • If the name of the RFC destination is not the same as Logical System name then assign the RFC destination to the logical system by using transaction BD97

     

    Message Control:

     

    Message Control is a cross application component used as a service program in several areas.  The biggest application is in pricing.

    The basic concept behind Message Control is to generate and manage outputs from an application and control their timing and medium of exchange

     

    The Benefits of Message Control

    • Disconnecting the process of creating an application document from the process of generating outputs.
    • Automatically proposing output based on business rules specified in Message Control.
    • Overriding the automatic proposal.
    • Manually selecting an output.
    • Generating multiple outputs.
    • Controlling the timing, medium and language of the output messages.
    • Retransmitting an output
    • Monitoring the results of execution.
    • Message control is a cross-application technology used in

              – Pricing.

              – account determination.

              – material determination.

              – output determination.

    • The output determination technique of message control triggers the ALE and EDI outputs for a business document. Message control separates the logic of generating IDocs from the application logic. Message control is used to determine the timing and the medium of the output at run time. Various business rules can be encapsulated in the message control to meet the business needs.
    • Transaction NACE is used to set up message control.

     

     

    Programs & Tables

    NAST: This table stores an entry for each output type created for an application document. It’s a table for storing Message Status.

    TNAPR: This table has an entry for the processing program used for an output type.
    RSNAST00:  This program is used to process entries in the NAST table.

    RSNAST00: This processing program exists for each output medium.  EDI_PROCESSING is a routine in the RSNASTED program to process EDI outputs.  The relationship of the output type, Output medium, and processing program is established in the TNAPR table.

     

     

                                ALE CONFIGURATION

     

    ALE Configuration is divided into 2 sections

     

    • General configuration which describes the basic settings required for ALE model to work
    • Process specific configuration which describes the settings required over and above the general settings specific to Outbound / Inbound Process.

     

    To establish ALE communication link between two SAP systems, various configuration links settings need to be done. These settings are as mentioned below:

     

      1. Defining Logical System Names for Clients
      2. Assigning Client to Logical System.
      3. Maintain RFC destination.
      4. Maintaining Distribution Model
      5. Generating Partner Profile
      6. Model Distribution

      • It also involves: 

    1. Filters
    2. Conversion rules
    3. Serialization

     

     

    Step-1

    Defining Logical System Names for Clients: (Transaction Code- BD54)

     

    To define the logical system, go to transaction SALE and choose:   Application Linking and enabling (ALE) -> Sending and receiving systems -> Logical Systems-> Define Logical Systems.

     

     

    Step- 2

    Assigning Client to logical System: (Transaction Code- SCC4)

     

    To assigning client to logical systems, go to transaction SALE and choose: Application Linking and enabling (ALE) -> Sending and receiving systems-> Logical systems-> Assign client To Logical System. A one-to-one relationship exists between client and logical system. Click on the 'New entries’ button to add a new entry.

     

     

    Step- 3

    Maintain RFC destination : (Transaction Code- SM59)

     

    The RFC destination maintains this communication channel and stores the required information to log onto remote system. Application Linking and enabling (ALE)-> Sending and receiving systems -> Systems in Network -> Define target systems for RFC Calls

     

    Creating RFC destinations: Transaction SM59:

     

    Click on the create button and add the details. Enter the name of the RFC destination (Usually it’s the same name as the logical system). Choose the connection type as 3 for R/3 Connection. Enter the target host name. The IP address or the host name of the receiving system. Enter the Logon details, which consist of the language, client, user and password. The system logs onto the remote system with the help of the details given here.

     

     

     

    Step- 4

    Maintaining distribution Model: (Transaction Code- BD64)

     

    Maintaining the Distribution model: Click on ‘Create model view’ and fill in the details as shown below the details to be filled in are:

    • Description/Text for the Distribution Model, Name of the Distribution Model
    • Logical system name (i.e. LS name of Sending system) in which the distribution
    • Start date is the date from which the Distribution model will be effective.
    • End date is the expiry date from Distribution Model.

     

    Maintaining the distribution model: Once the view is created, add a message type or BAPI.

    Add message type: To add message type, click on ‘Add Message Type’. Message type requires details such as:

         – Sender system

         – Receiver system

         – Message type and save the model. (MATMAS)

     

    Generating Partner profile: There are two ways to generate the partner profile:

    1. Manually from the transaction code BD64 (Environment-> Generate Partner Profile)
    2. Automatically through transaction BD82.

      Model distribution: It is necessary for it to be created in the receiving system to generate the partner profile.  

    • The distribution is done from the sending system.
    • To distribute the model go to edit-> Model view -> Distribute.

     

    Creating Material Master Data

    Once you have made all the settings required to distribute materials, you can create a material and then distribute it.

    Log on again to the sending system and follow these steps:
      • Choose Logistics -> Materials management -> Material master from the material master maintenance.
      • Choose Material -> Create (general) -> immediately.
      • Enter the material, industry sector and material type.

    Make sure that the industry sector and material type you enter are known in the receiving system. Otherwise, errors will occur when you post the material in the receiving system.

    Material: Material001 Industry sector: mechanical engineering Material type: finished product
    • Choose Select view and then Basic data.
    • Enter the basic data of your material.

     

    To avoid any errors occurring during data transfer, make sure that the receiving system will understand the information you have entered.

    Material short text: Material for ALE: First steps Base unit of measure: ST

    • Save the material.

    Sending Material Master Data

     

    You are now going to send the material you have just created to the receiving system.
    Choose General -> Material -> Send:

    • Enter the material you have created (for example, Material001).
    • Use ‘MATMAS’ Message type:
    • Enter  the receiving logical receiving system

    • Execute the program.

    You should now be able to display your material in the receiving system. If the material is not available here, either the transmission has not yet finished or an error has occurred. The next step shows you how to check the communication and detect any errors.

     

     

    Some Important Transaction Codes:

     

    • SALE  Display ALE Customizing
    • WE02 Display Idoc 
    • WE05 Idoc Lists
    • WE09 Search for Idoc in Database
    • WE19 Test tool      
    • WE20 Partner profiles
    • WE21 Port definition
    • WE30 Development Idoc Type  
    • WE31 Development Idoc Segment
    • WE41 Process codes, outbound
    • WE42 Process codes, inbound
    • WE60 Documentation for Idoc types
    • WE81 Logical message types
    • WE82 Assignment Messages for Idoc Type
    • BD64  Maintenance of Distribution Model
    • BD73  Re-posting of Idocs
    • BD83  Send IDocs after an ALE error
    • BD84  Post IDocs after ALE error
    • BD87  Manual Processing of Idocs

    In the Sending System (IB):

     

    Transaction Code for IDoc list is: WE05

    A list of IDocs grouped by status is displayed:

    Status              Description of Status 

     

    03, 12, 38        IDoc successfully transferred

    02, 04, 05, 25

    26, 29              Processing error

    30                    Waiting status (still processing...)      

    >=50                Inbound IDoc (not relevant in this context)  

    Other              Not relevant in this context

     

    In the Receiving System (OB):

     

    Transaction Code for IDoc list is: WE05

    A list of IDocs grouped by status is displayed:

    Status              Description of Status 

     

    53                    IDoc successfully updated by application     

    64                    Waiting status (still processing...)      

    <50                  Outbound IDoc (not relevant in this context)

    51, 56, 60, 61,

    63, 65              Inbound error 

    Other              Not relevant in this context

    About printing: WRITE causes a line feed. How to prevent this ?

    $
    0
    0

    Hello SDN members,
    I have a technical question about printing. Because of a very special project I need to send data to label printers via SAP spool. Smartforms or Adobe Interactive forms are not a possible alternative for us at this moments. We want to embed dynamically some bitmaps. That means, that I have to send data directly in printers language. For this I use a procedure like


    NEW-PAGE PRINT ON DESTINATION ...
    WRITE ....
    WRITE ....
    NEW-PAGE PRINT OFF.

     

    This report runs for several years. Now we must implenet new fuctionality of printing bitmaps. While implementing this, I recognized that the WRITE command will cut longer data or add a line feed (0x0A) automatically to the output stream if data exeeds a special line length. The new functionality is to print bitmaps, embetted by transaction SE78. For this I have to send the full bitmap data to the printer. Unfortunatly WRITE damages this data stream by inserting line feed.


    Example: this is a section of the spool data, copied by CTRL+Y and CTRL+C.

     

    {RC004;Bitmap test ...}{SG;0300,0500,0000,0000,2,
    424D52000000000000003E00000028000000050000        
    0005000000010001000000000000000000232E0000        
    232E00000000000000000000FFFFFF000000000087}    
    {XS;I,0001,0002C5100}{U1;0120}


    But I need a "longer" stream without line feeds like this:
                    
    {RC004;Bitmap test ...}{SG;0300,0500,0000,0000,2,424D52000000000000003E000000280000000500000005000000010001000000000000000000232E0000232E00000000000000000000FFFFFF000000000087}
    {XS;I,0001,0002C5100}{U1;0120}


    I think this is because SAP spool inserts a line feed because of the paper (or list) size.


    How can I prevent this ? Other possibilities ?

    Here you can see the code snippet


      DATA: lv_sg TYPE string,
            lxstr_data TYPE xstring,
            lstr_data TYPE string,
            lv_max TYPE i,
            lstr_line TYPE string,
            lv_pos TYPE i,
            lv_line_cnt TYPE i.

    ......
    ......


    * get the bitmap data stream
      CALL METHOD cl_ssf_xsf_utilities=>get_bds_graphic_as_bmp
        EXPORTING
          p_object       = 'GRAPHICS'
          p_name         = iv_bitmap_name
          p_id           = 'BMAP'
          p_btype        = 'BMON'
        RECEIVING
          p_bmp          = lxstr_data
        EXCEPTIONS
          not_found      = 1
          internal_error = 2
          OTHERS         = 3.

    * convert to string
      lstr_data = lxstr_data.

    ......
    ......

      CONCATENATE '{SG;' lv_offx ',' lv_offy ',' lv_sizex ',' lv_sizey ',2,'
        INTO lv_sg.

    * send to printer
      write lv_sg.

    * send bitmap data
      write lstr_data.

    * send terminator to printer
      write '|}'.

     

    The Result was a single but cutted data line, like:

     

    {RC004;Bitmap test ...}{SG;0300,0500,0000,0000,2,424D52000000000000003E0000002800


    The cutted part of the stream is lost then. So I tried to separate the data into smaller parts, like this:


    ******************************
    * create header

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

      CONCATENATE '{SG;' lv_offx ',' lv_offy ',' lv_sizex ',' lv_sizey ',2,'
        INTO lv_sg.

    * send to printer
      write lv_sg.

     

    *******************************
    * loop for bitmap data
    *******************************

    * convert to string
      lstr_data = lxstr_data.

    * get length of data
      lv_max = STRLEN( lstr_data ).

    * loop about the length        <=this workaround is made to part the full stream into smaller data streams
      DO lv_max TIMES.
        lv_pos = sy-index - 1. "fix the line counter

    * add character to line buffer
        CONCATENATE lstr_line lstr_data+lv_pos(1) INTO lstr_line.

    * if line buffer > 40
        IF lv_line_cnt > 40.
          lv_line_cnt = 0. "reset line buffer
          write lstr_line . "send line buffer to printer
          CLEAR lstr_line. "clear line buffer
        ELSE.
    * increase line buffer counter
          lv_line_cnt = lv_line_cnt + 1.
        ENDIF.

      ENDDO.

     

    *******************************
    * create terminator

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

    * send terminator to printer
      write '|}'.


    This leads to the effect, that SAP inserts line feed.

     

    Any idea ?!

    Thank you for helping me ...

     

    Regards,
    Markus

    Spool to Excel formatting

    $
    0
    0

    Experts,

     

    My report is writing output to spool. I have a field of type DFKKLOCKS-LOOBJ1 in spool output. When I download spool output to excel(using save to local file icon in SP01 Tcode) I see that value of LOOBJ1 column is not displayed as expected,

     

    Value in LOOBJ1 Column in Spool output,

     

    1000001350550000001000

    1000001350550000002000

    1000001350550000002000

     

    Value in LOOBJ1 Column in Excel file,

     

    1E+21
    1E+21
    1E+21

     

    When I format these cells to display data in number format, I can see incorrect values as below,

     

    1000001350550000000000
    1000001350550000000000
    1000001350550000000000

     

    I am getting correct values only upon "Use Text Import Wizard" feature of Excel.

     

    Is there a way we can display the value correctly in Excel so that users need not manually format data each time.

     

    Thanks,

    Aspire

    AS ABAP 7.4 trials as virtual appliances: Questions and feedback

    $
    0
    0

    This thread should serve as container for all discussions, questions and feedback concerning the new AS ABAP 7.4 trials provided as virtual appliances by the SAP Cloud Appliance Library. For more information about these trial appliances please visit the corresponding page on SCN.


    2 seperate alv grid in total different environment, why display the same thing?

    $
    0
    0

    Hi  friends,

     

    I have use one alv grid to edit some line items, then a second alv grid to display line items after simulation.

     

    Once I called the first alvgrid, then when I call the 2nd alv grid, it will display the same content in the first alv grid, though they are using different instances which are declared different function groups.

     

    The alv grid must have a buffer, otherwise how 2 different alv grid connected together.

     

    The alv grid is created in a container. My first try is to change the container name below, once I change something to ALVSUB1, the alv grid will not display anything.

     

     

    CREATE OBJECT GR_CONTAINER_SUB

                     EXPORTING

                        CONTAINER_NAME = 'ALVSUB'.

     

    1st alv grid calling code:

     

     

    ls_variant-report = 'GR_ALVGRID_ITEM_S2I'.

     


    CALL METHOD gr_alvgrid_itm_s2i->set_table_for_first_display

    EXPORTING

           is_variant           = ls_variant

            i_save               = 'A'

            is_layout            = ls_layout

          i_buffer_active      = 'X'

            it_toolbar_excluding = lt_exc_func

    CHANGING

            it_fieldcatalog      = lt_fieldcat_items[]

            it_outtab            = gt_output_items[].

     

     

    2nd alv grid calling code:

     

     

    CALL METHOD GR_ALVGRID_ITM->SET_TABLE_FOR_FIRST_DISPLAY

        EXPORTING

          IS_VARIANT           = LS_VARIANT                     
          I_SAVE                   = 'A'                            
          IS_LAYOUT            = LS_LAYOUT

          I_BUFFER_ACTIVE      = 'X'

          IT_TOOLBAR_EXCLUDING = LT_EXC_FUNC

        CHANGING

          IT_FIELDCATALOG      = LT_FIELDCAT_ITEMS[]

          IT_OUTTAB            = GT_ITEMS[].

     

     

    In 2nd alv grid, it will ignore GT_ITEMS and will display GT_OUTPUT_ITEMS instead. If 2nd alv grid is called first, then the first will display the GT_ITEMS instead of GT_OUTPUT_ITEMS.

     

    Who can tell me what I did wrong, that 2 alv grids are linked somehow together?

     

    Thank you

     

    Swing

     



    Export attachments from CRM documents in background mode

    $
    0
    0

    Hello,

     

    There is an attempt to extract all attachments from CRM transactional documents to put them onto an external contents management server. By leveraging SAP's functionality of exporting individual attachments, we have programmed to use the CRM document GUID, the business object (Eg.: BUS2000115), to retrieve the CRM KW object type ('P'), class ('CRM_P_ORD') and ID (GUID) of the attachment using CL_CRM_DOCUMENTS=>GET_INFO method.

     

    Using the CRM KW object type ('P'), class ('CRM_P_ORD') and ID (GUID) in structure PHIOS in FM 'CRM_KW_DOC_EXPORT', we can download the attachments onto a local (presentation server) folder. However, due to the number of documents involved, we would need to run it as a background job. Hence, we've re-engineered FM CRM_KW_DOC_EXPORT (on a 'Z' version) by removing the call to CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD and putting in its place the following -

     

    DATA : lv_buffer     TYPE xstring. 

     

      OPEN DATASET ls_filename IN BINARY MODE FOR OUTPUT MESSAGE mess.
      IF sy-subrc EQ 0.

        CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
          EXPORTING
            input_length = p_size
          IMPORTING
            buffer       = lv_buffer
          TABLES
            binary_tab   = lt_content.

        TRANSFER lv_buffer TO ls_filename.

        CLOSE DATASET ls_filename.

     

    The file gets saved onto the application server folder, but the entire contents of the attachment are lost (i.e) the file is a blank document.

     

    Have we missed a crucial step ? Has anyone mastered such a scenario ? Would like to hear some viewpoints.

     

     

    TIA,

    Ashok.

     

    We do have a working solution of exporting the attachments as a foreground job.

    PCL commands to access printer special fonts in lexmark printer?

    $
    0
    0

    PCL commands to access printer special fonts in lexmark printer? PCL commands to access any printer special fonts like MICR and any other special fonts in sap scripts. if i have to create new PCL command for ZSAPWIN device type, advise the procedure to follow.

    MESSAGE TYPE X with Commit Rollback error

    $
    0
    0

    Hi all,

     

         am getting a dump error with MESSAGE TYPE X with COMMIT or ROLLBACK error while using J1IF01 particularly in PRODUCTION system.

    any idea,

    searched @SCN found similar thread http://scn.sap.com/thread/349244

     

    Please find me a solution if you fixed with similar issues.

     

    thanks,

    Sankaresh S

    Code for price condition FORM FRM_KOND_BASIS_900

    $
    0
    0

    Hi;

     

    I need help with the following:

     

    1) i've already place this code to get a value in FORM FRM_KOND_BASIS_900:

     

    DATA: lv_ztag1      TYPE t052-ztag1,

             lv_tasa_iind  TYPE ZTASA_IIND,

             lv_resultado  TYPE DECFLOAT34.

     

    IF komk-zterm(1) = 'S' AND xkomv-kschl = 'ZIND' AND SY-UCOMM = 'SICH'.

    *   Recupera la Tasa de interés vigente

       SELECT SINGLE tasa_iind INTO lv_tasa_iind FROM ZSD_TASA_INT_IMP WHERE desde LE komk-PRSDT AND hasta GE komk-PRSDT.

     

    *   Recupera la cantidad de dias según condiciones de pago de factura y calcula interés no devengado

       SELECT single ztag1 INTO lv_ztag1 FROM t052 WHERE zterm = komk-zterm.

         IF  lv_ztag1 GE 90.

           LV_RESULTADO  = ( ykwert /  ( ( 1 + ( lv_tasa_iind / 10000 ) ) ** ( lv_ztag1 / 360 ) ) ).

     

           xkwert = LV_RESULTADO.

         ENDIF.

    ENDIF.

     

    2) what we need is that the passed value [xkwert = LV_RESULTADO.] doesn't affect any prior calculation. This is the last condition in VA01,02, 03 tcode, so it suposses no to affect the other calculations.

     

    3) when i pass value xkwert = LV_RESULTADO. the value gets in field xkomv-kawrt instead xkomv-kbetr.

     

    4) in tcode VA02 or VA03 we are no getting the stored value in KONV table for ZIND price condition.

     

     

    Any help please.

     

     

     

    David Fúnez

    Latacunga, Ecuador

    Viewing all 8332 articles
    Browse latest View live