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

XSLT-ABAP using Call Transformation

$
0
0

Hello Friends,

 

I am new to this XSLT-ABAP transformation. I went through the blogs and forums and got a fair bit of idea on this. Now, i am trying to create a simple program/ xslt transformation to test the scenario. Once this is successfull i need to implement this in our project.

 

I am not sure, where and what i am doing wrong. Kindly check the below given XSLT/ XML/ ABAP Program and correct me.

 

My XML File looks as given below:

  <?xml version="1.0" encoding="utf-8" ?> 
- <List>
- <ITEM>  <ITEMQUALF>ITEM1</ITEMQUALF>   <MATERIAL>MAT1</MATERIAL>   </ITEM>
- <ITEM>  <ITEMQUALF>ITEM2</ITEMQUALF>   <MATERIAL>MAT2</MATERIAL>   </ITEM>
- <ITEM>  <ITEMQUALF>ITEM3</ITEMQUALF>   <MATERIAL>MAT3</MATERIAL>   </ITEM>  </List>

 

My XSLT Transformation looks as given below:

<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sap="http://www.sap.com/sapxsl" version="1.0">  <xsl:strip-space elements="*"/>  <xsl:template match="*">    <List>      <xsl:for-each select="ITEM">        <xsl:element name="ITEM">          <xsl:element name="ITEMQUALF">            <xsl:value-of select="ITEMQUALF"/>          </xsl:element>          <xsl:element name="MATERIAL">            <xsl:value-of select="MATERIAL"/>          </xsl:element>        </xsl:element>      </xsl:for-each>    </List>  </xsl:template></xsl:transform>

 

My ABAP program looks as below:

REPORT  ztest_ram.

TYPES:
  BEGIN OF ty_test,    itemqualf TYPE char10,    material  TYPE char10,  END OF ty_test,  ty_t_test TYPE STANDARD TABLE OF ty_test.

DATA:
  l_xml       TYPE REF TO cl_xml_document,  t_test      TYPE ty_t_test,  wa_person   TYPE LINE OF ty_t_test,  t_xml_out   TYPE string,  v_retcode   TYPE sy-subrc,  v_totalsize TYPE i.

DATA: gs_rif_ex     TYPE REF TO cx_root,      gs_var_text   TYPE string.

* Create object
CREATE OBJECT l_xml.
* Call method to import data from file
CALL METHOD l_xml->import_from_file  EXPORTING    filename = 'C:\xml\xml_test.xml'  RECEIVING    retcode  = v_retcode.
* Call method to Render into string
CALL METHOD l_xml->render_2_string  IMPORTING    retcode = v_retcode    stream  = t_xml_out    size    = v_totalsize.
* Call Transformation
TRY.    CALL TRANSFORMATION (`ZXSLT_RAM`)            SOURCE XML t_xml_out            RESULT     outtab = t_test.  CATCH cx_root INTO gs_rif_ex.    gs_var_text = gs_rif_ex->get_text( ).    MESSAGE gs_var_text TYPE 'E'.
ENDTRY.

 

When i run this ABAP program to fetch the data from XML in to Internal table, i get the error message:

Incorrect element List for XML-ABAP transformation

 

I am really not sure how to proceed further. Could any one help me on this?

 

Note: Please do not paste the same links, as i have gone through most of them.

 

Thank you.

Best Regards,

Ram.


Performance issue while using Select Query

$
0
0

Data:LT_GLT0             TYPE SORTED TABLE OF GLT0 WITH NON-UNIQUE KEY BUKRS RACCT,

 

 

 

 

SELECT * FROM SKB1

    INTO TABLE LT_SKB1

    WHERE BUKRS IN BUKRS AND

          SAKNR IN SAKNR AND

          WAERS IN WAERU AND

          FDLEV IN FDLEV

    ORDER BY BUKRS.

 

 

The below table is taking very long time and could you please any one  can give any suggestions on this.

 

 

SELECT * FROM GLT0

      INTO TABLE LT_GLT0

      FOR ALL ENTRIES IN LT_SKB1_TMP

      WHERE  RLDNR = '00'       AND

             RRCTY = '0'        AND

             RVERS = '001'      AND

             BUKRS = LT_SKB1_TMP-BUKRS AND

             RYEAR = LV_GJAHR   AND

        "    racct = lt_skb1-saknr AND

             RBUSA = SPACE      AND

             RPMAX = '16'.

 


 

As per my analysis that

 

  1.Instead of using  SELECT * FROM GLT0 and I will be specify the column names which are required.

  2.I will  be remove the FOR ALL ENTRIES  and will be using INNER JOIN.

 

 

Any other suggestions which can help the performance?

 

it is taking very huge time to execute the Query

Why no procedure generated in SAPHANAABAP by AMDP call?

$
0
0

I have implemented and activated a class with an AMDP call:

 

METHOD MY_HANA_PROCEDURE BY DATABASE PROCEDURE FOR HDB LANGUAGE SQLSCRIPT.


Now I expect a corresponding generated HANA procedure to appear under the schema SAPHANAABAP.


I do see a bunch of procdures from preinstalled demos e.g.   "ZCL_AMDP_SIMPLE_00=>GET_CUSTOMER_INFOS" but not the one I created.


What is wrong/missing?


How can I get data from Message class in Smartforms

$
0
0

Hello gurus,

I have desginaed an smartform,  my functional team says, that they will be send the data from ME21N and from message class, but I dont know what  I need to do to get information, in my requeriment, I have the data type I need show. Please see below:

-Purchase Order Nbr:EBELN

- BILL TO / FACTURAR A: BURKS

 

SUPPLIER /PROVEEDOR: LIFNR

- PROMISED DATE / FECHA DE ENTREGA: LFDAT

-Project/Centro de costos KOSTL , DISUB_PSPNR

-Requisition/ Solicitud de Pedido:BANFN

Description/Descripción TXZ01

-Unit/Unidad MEINS

-Quantity/Cantidad  BSMNG

 

SMARTFORM.png

 

 

My question is, what table type I need to define to get data? How can I catch information to be show in my smartforms???

 

How can I define a table type a message class to get information and show in my smartforms? it is possible something like this: MESSAGE E004(ZR0) INTO  IT_MessageClass

BAPI_CONTRACT_CHANGE not updating supplying vendor (SUPPL_VEND)

$
0
0

Hi Folks,

 

I am trying to update the supplying vendor field in outline agreement header ( Reference data section ) using bapi BAPI_CONTRACT_CHANGE. I am passing the supplying vendor in in HEADER-SUPPL_VEND field and setting HEADERX-SUPPL_VEND to 'X'.

The execution ends with success message but the new supplier vendor does not show up in outline agreement.

 

Has anyone faced similar issue when using this BAPI. I have noticed the header structure of bapi has a field to allow update of vendor but event that does not work (which makes sense ), But the supplier vendor field can be updated in edit mode by end user, so this should ideally be updated when using BAPI.

 

Any input will be helpful in this regard.

 

Cheers,

Vivek


how to archive CATSCO and CATSPM tables

$
0
0

Hi,

 

How to archive CATSCO and CATSPM tables? as there is no archiving objects for these tables.

Is there any way to archive these tables?

 

Regards,

Balavardhan.K

How to introduce a change log to a standard transaction?

$
0
0

Hi

I am a PM consultant  and I need some technical advise from ABAP Gurus. I wonder whether there are ways to introduce change logs to standard SAP transactions/Tables. I am specially focusing on two different Standard Texts, one used in mostly in PM/PP and the other used for general purposes. Currently my client has been using both of these but they would like to enable them to be used as controlled documents which means they would like to add more control over them including the change log. 

 

The transaction codes for those are:

  • CA10 - Standard text for PM/PP Order operations. (Table T435  & T435T for the header)
  • SO10 for the general Standard Text

The change log should be able to capture the changes within the text and/or long texts and write them down in CDHDR/CDPOS if possible, or to a Z-Table,

 

 

Any form of help and advise would be highly appreciated.

Kind regards

Savas

Small window when using multiselect in search help exit

$
0
0

I have defined a search help and have a requirement to retrieve multiple reason codes from the search help, thus I have also defined a search help exit.  In the search help exit I have the parameter CALLCONTROL-MULTISEL = 'X'.  Once I do this I am able to retrieve multiple values into the RECORD_TAB and concatenate them into a single field which I bring back to the main program.

 

The problem is that whenever I use CALLCONTROL-MULTISEL = 'X' I get this small popup window next to the search help dialog.  If I remove this parameter from the exit, the window does not appear but I am only able to select one entry.

 

Also, if I close the small window that appears, the transaction crashed when selecting entries from the search help dialog.  Has anyone ever seen this window appear before and/or know how to get rid of it?

 

Thanks.

 

small_window.PNG


type numc

$
0
0

Hi,

 

A field type has changed from NUMC(3) to NUMC(4) in an active database table with data already.

 

Now coexits boths values with and without leading 0. Example: 101 and 0101.

 

 

How is it possible?

 

 

Already adjust the table but with no effect.

 

I suppose that just one value was possible: 0101!

 

Can you explain please?

 

Thanks.

Regards,

Maria João Rocha

What Class this Method ?

$
0
0

Dear SAP Gurus,

 

I am using the following method.

I would like to find the class on which one the method is available

Do you how is it possible to find the class corresponding to this method ?

 

 

    CALL METHOD P_R_REQUEST->get_TGT

 

       RECEIVING

 

          R_TGT = I_TGT.

 

Cheers

Modify visualization LT10

$
0
0

Hello experts.

 

Is possible modify the visualization of report LT10??

 

 

I would like to add a new column in this report that display the information of field MKPF-XBLNR

 

Is there any user-exit?

 

attached image...

How many unit tests in our system?

$
0
0

Hey ABAPers,

 

I know how to run all of our unit tests using Code Inspector and it reports if any failed and how many 'programs' have been tested. However, I can't seem to find an easy way to determine exactly how many unit test methods we have in our system. We are on NW 7.0...

 

If anyone knows an easy way to determine how many unit tests are in the system I would love to know!

 

Thanks,

Lucas

How to extract the data into Excel / PDF from SAP

$
0
0

Hi,

 

We have spool number of a report output.

 

We want to extract the data into Excel / PDF from SAP directly...

 

Plz guide...

Passing communication tax data from SAP to Vertex

$
0
0

Hi,

 

We have an existing  connection between SAP and Vertex. We received a requirement to pass a new tax field to vertex. This new Z field is not present in COM_TAX structure. But looks like if we add this new field to com_tax structure, we need to modify several other structures before we call the call RFC which passes data to VERTEX.

 

Could anyone suggest, how to add a new field in SAP and pass it to Vertex from a sales order pricing routine in a simple way? Appreciate your help.

 

Thanks,

Pavan

How to passing data to an SMARTFORM from Y640FM06P program (Purchase Order)

$
0
0

Hello Gurues,

 

I am very n00b in smartforms, I want to know how can I pass an Internal Table from my zprogram to my smartform layout and access to this data and show in my smart. Please see my steps below:

 

1._ I configured in NACE my Ouput Type, smartorm and Yprogram:

nace1.PNG

2._ I go to ME23N and I can see the PO:

me23n.PNG

3._ I set a Break Point in my Y640FM06P program driver.

 

4._ When I click on Print Button I go to debug mode and I can see the Internal table with the same data in ME23N:

tabla.PNG

As you remember In second screen(ME23N) I hace the same data.

 

Now, question its, How can I set this data and variables to my smartform?  I want to print this information in my smartform.

 

NOTE:  This table its a deep structure:

1tabla.PNG

l_doc contains all information from my purchase order.

 

Please explain me how can I send this data to my smartform

 

In my code I have this:

CALL FUNCTION lf_fm_name

     EXPORTING

       archive_index      = toa_dara

       archive_parameters = arc_params

       control_parameters = ls_control_param

       mail_recipient     = ls_recipient

       mail_sender        = ls_sender

       output_options     = ls_composer_param

       is_ekko            = l_doc-xekko

       user_settings      = ' '  "Disable User Printer

       is_pekko           = l_doc-xpekko

       is_nast            = l_nast

       iv_from_mem        = l_from_memory

       iv_druvo           = iv_druvo

       iv_xfz             = iv_xfz

     TABLES

       it_ekpo            = l_doc-xekpo[]

       it_ekpa            = l_doc-xekpa[]

       it_pekpo           = l_doc-xpekpo[]

       it_eket            = l_doc-xeket[]

       it_tkomv           = l_doc-xtkomv[]

       it_ekkn            = l_doc-xekkn[]

       it_ekek            = l_doc-xekek[]

       it_komk            = l_xkomk[]

     EXCEPTIONS

       formatting_error   = 1

       internal_error     = 2

       send_error         = 3

       user_canceled      = 4

       OTHERS             = 5.

 

   IF sy-subrc <> 0.

     ent_retco = sy-subrc.

     PERFORM protocol_update_i.

 

     "--- get SmartForm protocoll             ---

     "--- and store it in the NAST protocoll  ---

     PERFORM add_smfrm_prot.



In others exanples says I need to do this, ok? I assume this is done, now, How Can I manage the data or get it in my smartform?


Error BAPI_CONTRACT_CREATE ID 06 Number 76

$
0
0

Hello, I hace a problem with BAPI_CONTRACT_CREATE.

 

I created an outline agreement with reference to a purchase requisition not using the whole ammount. Then I try to create another outline agreement with reference to the same purchase requisition for the remaining amount, however, when trying to create the second one I get the following error:

 

ID: 06

Number: 076

Message: Materials of requisition & item & alr. ordered in full

 

However it's not true, the materials for the requisition being used is not ordered in full....

 

The BAPI throws the error on method COMPATIBILITY_CHECK (LCL_INDEX_CON), include: LMEREQSF01 when trying to validate the following:

 

 

* no reference to fully ordered PR

    l_eban = l_req->if_purchase_requisition_item~get_persistent_data( ). "1339645

    CHECK im_creqs-varkey(1) = '#'.                         "1346997

    IF l_eban-menge LE l_eban-bsmng OR

       l_eban-ebakz NE space OR

       l_eban-bsakz EQ 'R' AND

     ( l_eban-statu EQ 'K' OR

       l_eban-statu EQ 'L' ).

      re_success = mo_const->no.

      MESSAGE e076(06) WITH im_creqs-banfn im_creqs-bnfpo INTO gl_dummy.

      mmpur_message_forced sy-msgty sy-msgid sy-msgno

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

    ENDIF.

  ENDMETHOD.                    "compatibility_check


The values for our variables are:


L_EBAN-MENGE = 100.000

L_EBAN-BSMNG = 0.00

L_EBAN-EBAKZ = ' '

L_EBAN-BSAKZ  = 'R'

L_EBAN-STATU = 'K'


KNTTP and PSTYP for both utline agreements (the one succesfully created and the one with error):


KNTTP = U

PSTYP = 8


I'd really appreciate your help!!!


Best Regards.

ABAP Object Class

$
0
0

Hi Experts,

 

Need an advise on the following codes.

 

TYPES: BEGIN OF gty_obj,

           PLVAR TYPE hrp1001-PLVAR,

           OTYPE TYPE hrp1001-OTYPE,         

           objid TYPE hrp1001-objid,

      END OF gty_obj.

 

TYPES: gtab_obj TYPE STANDARD TABLE OF gty_obj INITIAL SIZE 0.

DATA: gt_obj TYPE gtab_obj.

 

DATA: candidate type ref to CL_HRRCF_CANDIDATE_PREVIEW_BL.

 

 

CALL METHOD candidate->GET_PERSONAL_DATA

  EXPORTING

    CAND_OBJ      = gt_obj.

 

 

Keep getting below error message:

"GT_OBJ" is not type-compatible with formal parameter "CAND_OBJ".

SQ02 - Data retrieval by program

$
0
0

Hi!

 

I have created an infoset using "data retrieval by program" option.

I added new fields in the structure used by the infoset but I don´t see these changes in SQ02.

What do I have to do to see them? Is there an option in SQ02? Or I have to create the infoset again?

 

Thanks!

Cristian

Updating Gross weight(MARA-BRGEW) in the transacation MM03

$
0
0

Hi everyone,

 

Can somebody tell me how I can update the gross weight in the standard transaction MM03 in SAP ?

Which BAPI i can use to update the gross weight ?

 

So i need to update this field

mm03-gross-weight.png

The Gross Weight should have the same value like Net Weight - 2,618.

 

I use the bapi -  BAPI_MATERIAL_SAVEDATA. And in the table - UNITSOFMEASURE i pass the new value in the field GROSS_WT.

So i make this valorization of the bapi UNITSOFMEASURE-GROSS_WT = 2.618 and UNITSOFMEASURE-UNIT_OF_WT = KG.

In the end i valorize UNITSOFMEASUREX-GROSS_WT = 'X' UNITSOFMEASUREX-UNIT_OF_WT = 'X'.

 

But this valorization only updates this field

 

Screenshot_1.png

 

So is there in any other solution for this ?

Some other BAPI maybe ?

I checked the other structures and tables in the BAPI - BAPI_MATERIAL_SAVEDATA, but only the table UNITSOFMEASURE has the field Gross weight.

 

Thanks,

Dime Slavkov

How to extract 1.4 L data from a table at a time

$
0
0


Hello Experts,

 

I have a requirement to extract to 1.4L data fram a table at a time.

Is it possible...

 

 

Thanks

Viewing all 8332 articles
Browse latest View live


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