Quantcast
Channel: SCN : Popular Discussions - ABAP Objects
Viewing all 626 articles
Browse latest View live

Drop-down values in ALV grid

$
0
0

I'm using the class CL_GUI_ALV_GRID.

I want to create a drop-down field on a column of the grid so to show in the ALV a text but the real value saved in the internal table is a code.

I'm using the method SET_DROP_DOWN_TABLE using the table parameter IT_DROP_DOWN_ALIAS: the structure of this table contains two fields, VALUE and INT_VALUE, used to contain, respectively, the value to be saved in the internal table and the text to be showed in the ALV.

When the drop-down is select the text is showed but after a refresh of the ALV the text is substituted by the internal value.

Is there a way to always show the text value and not the internal value of the drop-down ?

 

Thanks,

Antonino Musciumarra


simple ALV using oops example

$
0
0

HI Experts

 

Im new to this forum . Can some one send a sample code to create a simple alv using oops.

 

Thanks and regards

Anish

get field name from dynamic structure

$
0
0

I have a dynamic structure of a dynamic table.  I want to loop thru table and check if there is field name 'ABC' exist in the structure.  If it exists, depending on value of the field I will change value of another field in the structure. 

For example if field struct-fieldname = 'ABC ' and field value = 'S', I will display field XYZ (struct-xyz) as positive, otherwise display as negative.  Can this be achieved using dynamic structure and dynamic table via field symbol?  Thanks

difference between class and interface

$
0
0

Hi experts,

 

Can any one please tell me what is the difference between an interface and a class.

 

Please let me know the answer for the same with a small example.

Drop-down values in ALV grid

$
0
0

I'm using the class CL_GUI_ALV_GRID.

I want to create a drop-down field on a column of the grid so to show in the ALV a text but the real value saved in the internal table is a code.

I'm using the method SET_DROP_DOWN_TABLE using the table parameter IT_DROP_DOWN_ALIAS: the structure of this table contains two fields, VALUE and INT_VALUE, used to contain, respectively, the value to be saved in the internal table and the text to be showed in the ALV.

When the drop-down is select the text is showed but after a refresh of the ALV the text is substituted by the internal value.

Is there a way to always show the text value and not the internal value of the drop-down ?

 

Thanks,

Antonino Musciumarra

Why do we need Persistent Classes ?

$
0
0

Dear OO Gurus,

 

I just finished the chapter on "Persistent Objects" in "ABAP Objects - ABAP Programming in SAP NW by Horst Keller".

 

I could really appreciate its utility though. Googled a bit, read a few blogs on SCN but still the utility remains blurred.

 

I would like to know what is the advantage of Persistence Classes over Open SQL.

 

BR,

Suhas

Sending attachment using class cl_document_bcs as PDF

$
0
0

Hi All,

   

  As my Post has been rejected from SAP Community Network Forum,  Sorry for posting my thread in two categoires.

 

  I have tried to search for solution in SDN but could not found a relevent solution.

   

  I am able to send an Internal table using cl_document_bcs class to send XLS and Doc types as attachment as follows:

  For Example :

  My Internal table is tbl_bseg which final output table:

 

   

data : lv_string  TYPE string.

*-   tbl_bseg contains my data so..  LOOP AT tbl_bseg INTO wa_bseg.     CONCATENATE lv_string wa_bseg-bukrs wa_bseg-belnr wa_bseg-gjahr wa_bseg-buzei                 wa_bseg-zumsk CN_CR_LF INTO lv_string SEPARATED BY CN_TAB.
*-     Horizontal Tab Stop Character
*-   Carriage Return and Line Feed    CLEAR wa_bseg.   ENDLOOP.   DATA:  lv_xstring TYPE xstring,      ta_excelx  TYPE SOLIX_TAB.

*- Convert the string into xstring
  call function 'SCMS_STRING_TO_XSTRING'   exporting     TEXT     = p_string   IMPORTING     BUFFER   = lv_xstring   EXCEPTIONS     FAILED         = 1     OTHERS         = 2.  IF SY-SUBRC  0.   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO           WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.  ENDIF.

*-  Convert the string into binary table
 CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'   EXPORTING     buffer     = lv_xstring   TABLES     binary_tab = ta_excelx.

*-
 wa_attachments-type         = 'XLS'
 wa_attachments-subject      = 'This final testing - XLS'.
 wa_attachments-content_hex  = lv_xstring.
 APPEND wa_attachments to ta_attachments.

*-------- create and set document with attachment ---------------
     cl_documents = cl_document_bcs=>create_document(                     i_type    = CN_RAW                     i_text    = gta_body                     i_subject = wa_subject ).

*     add attachment to document       CALL METHOD cl_document_bcs->add_attachment       EXPORTING  i_attachment_type    = wa_attachments-TYPE                            i_attachment_subject = wa_attachments-SUBJECT                            i_att_content_hex    = wa_attachments-CONTENT_HEX.

 

But my issue is to send a the same Internal Table tbl_bseg as attachement as PDF using in the same steps:

A sample snippet of code could be helpful or any valuable solution are welcome.

 

Regards,

Suneel G

sample code using CL_GUI_TEXTEDIT

$
0
0

Hi gurus,

 

I have a requirement to create a text editor in a screen using which data can be save multiple lines in a custom table and can view in display mode. how to use class CL_GUI_TEXTEDIT for this.

 

thanks.


simple ALV using oops example

$
0
0

HI Experts

 

Im new to this forum . Can some one send a sample code to create a simple alv using oops.

 

Thanks and regards

Anish

Delete Duplicates from internal table with object references

$
0
0

Hi

 

How can I delete duplicates from an internal table in ABAP OO based on the value of one of the attributes?

 

I have created a method, with the following code:

......  LOOP AT me->business_document_lines INTO l_add_line.    CREATE OBJECT ot_line_owner      EXPORTING        i_user      = l_add_line->add_line_data-line_owner        i_busdoc = me->business_document_id.      APPEND ot_line_owner TO e_line_owners.  ENDLOOP.
.....

 

e_line_owners are defined as a table containing only object references.

 

One of the attribute of the object in the table is called USER. And I would like to do a "delete ADJACENT DUPLICATES FROM e_line_owners", based on that attribute.

How can do this?

 

Regards,

Morten Nielsen

simple ALV using oops example

$
0
0

HI Experts

 

Im new to this forum . Can some one send a sample code to create a simple alv using oops.

 

Thanks and regards

Anish

Drop-down values in ALV grid

$
0
0

I'm using the class CL_GUI_ALV_GRID.

I want to create a drop-down field on a column of the grid so to show in the ALV a text but the real value saved in the internal table is a code.

I'm using the method SET_DROP_DOWN_TABLE using the table parameter IT_DROP_DOWN_ALIAS: the structure of this table contains two fields, VALUE and INT_VALUE, used to contain, respectively, the value to be saved in the internal table and the text to be showed in the ALV.

When the drop-down is select the text is showed but after a refresh of the ALV the text is substituted by the internal value.

Is there a way to always show the text value and not the internal value of the drop-down ?

 

Thanks,

Antonino Musciumarra

get field name from dynamic structure

$
0
0

I have a dynamic structure of a dynamic table.  I want to loop thru table and check if there is field name 'ABC' exist in the structure.  If it exists, depending on value of the field I will change value of another field in the structure. 

For example if field struct-fieldname = 'ABC ' and field value = 'S', I will display field XYZ (struct-xyz) as positive, otherwise display as negative.  Can this be achieved using dynamic structure and dynamic table via field symbol?  Thanks

what is ABAP Proxy ??

$
0
0

Hi ,

What is an ABAP proxy? and what are proxies in general .

 

points to be given .

 

thanks

Select rows in ALV grid with CL_GUI_ALV_GRID

$
0
0

Hi all,

 

i'm using class CL_GUI_ALV_GRID and i want the buttons at begin of every row to select it.

With the classic function REUSE_ALV_GRID_DISPLAY i used the layout parameter box_fieldname:

<b>layout-box_fieldname       = 'CBOX'.</b>

where CBOX is the name field of my internal table in the first position (char1)

and it works.

 

with the CL_GUI_ALV_GRID ther's not parameter box_fieldname but BOX_FNAME.

<b>layout_alv-BOX_FNAME = 'CBOX'.</b>

When i call the method

 

    call method grid->set_table_for_first_display

      EXPORTING

        is_layout                   = layout_alv

      CHANGING

        IT_FIELDCATALOG   = it_fieldcat_voci

        it_sort                       = gt_sort_grid[]

        it_outtab                   = gt_voci[].

 

it doesn't work.

Somebody knows why? Do i have to do something else?

 

 

Thanks a lot?

Massimo.


Documentation for ABAP OOPS

$
0
0

Hello experts,

 

Is there any documentation available for understanding the Object Oriented Programming using ABAP ?

 

I tried searching but could not find anything which would briefly give me a concept for implementing classes and objects in ABAP.

 

Thanks in advance.

Shubhendu

ABAP Object (Up cast, Down Cast)

$
0
0

Someone should let me know.

 

Version 4.70 Enterprise was as follows.

" Up Cast (Narrowing-Cast)

  superclass = subclass.

" Down Cast (Widening-Cast)

  subclass ?= superclass.

 

It is why the help of F1 is changed as follows from the version ECC 6.0.

(Widening-Cast and Narrowing-Cast became reverse.)

" Up Cast (Widening-Cast)

  superclass = subclass.

" Down Cast (Narrowing-Cast)

  subclass ?= superclass.

get field name from dynamic structure

$
0
0

I have a dynamic structure of a dynamic table.  I want to loop thru table and check if there is field name 'ABC' exist in the structure.  If it exists, depending on value of the field I will change value of another field in the structure. 

For example if field struct-fieldname = 'ABC ' and field value = 'S', I will display field XYZ (struct-xyz) as positive, otherwise display as negative.  Can this be achieved using dynamic structure and dynamic table via field symbol?  Thanks

Using CL_BCS to send email from ABAP

$
0
0

Hello Gurus,

 

I have an ABAP program that creates an email and sends it to a list of Users, this works with no

problems, I'm using the CL_BCS class to do this.

 

My problems is that they want to include a logo in the body of the email (no attachment)

and I have searched SDN but haven't found my answers.

 

I need your help.

 

Thank you in advance.

simple ALV using oops example

$
0
0

HI Experts

 

Im new to this forum . Can some one send a sample code to create a simple alv using oops.

 

Thanks and regards

Anish

Viewing all 626 articles
Browse latest View live


Latest Images

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