Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

need space while display a row

Former Member
0 Kudos

hi ,

Name                                                    Capital

Andhra Pradesh

Hyderabad

Visakhapatnam

Warangal

Nellore

This is the output I am getting now but I should get like the below data

Name                                                    Capital

Andhra Pradesh

     Hyderabad

     Visakhapatnam

     Warangal

     Nellore

for state name extreme left and for distric they need some space as i shown in.

This is ALV Report

Please help meee

1 ACCEPTED SOLUTION

former_member585060
Active Contributor
0 Kudos

Hi,

    Use ' HTML_TOP_OF_PAGE' for your requirment.

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

   FORM html_top_of_page USING  lcl_document
                             TYPE REF TO cl_dd_document.

  DATA: lv_text(255) TYPE c.

  lv_text = 'Name'(100).

  CALL METHOD lcl_document->add_text

    EXPORTING

      text         = lv_text

      sap_emphasis = cl_dd_area=>strong " For bold

      sap_style    = cl_dd_area=>heading

      sap_fontsize = cl_dd_area=>large

      sap_color    = cl_dd_area=>list_heading_int.

  CLEAR : lv_text.


* Adding GAP
  CALL METHOD lcl_document->add_gap
    EXPORTING
      width = 130.

  lv_text = 'Capital(101).

  CALL METHOD lcl_document->add_text
    EXPORTING
      text         = lv_text
      sap_emphasis = cl_dd_area=>strong " For bold
      sap_style    = cl_dd_area=>heading
      sap_fontsize = cl_dd_area=>large
      sap_color    = cl_dd_area=>list_heading_int.

  CLEAR : lv_text.

* Add new-line
  CALL METHOD lcl_document->new_line.

ENDFORM.   "html_top_of_page

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

Thanks & Regards

Bala Krishna

8 REPLIES 8

former_member585060
Active Contributor
0 Kudos

Hi,

    Use ' HTML_TOP_OF_PAGE' for your requirment.

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

   FORM html_top_of_page USING  lcl_document
                             TYPE REF TO cl_dd_document.

  DATA: lv_text(255) TYPE c.

  lv_text = 'Name'(100).

  CALL METHOD lcl_document->add_text

    EXPORTING

      text         = lv_text

      sap_emphasis = cl_dd_area=>strong " For bold

      sap_style    = cl_dd_area=>heading

      sap_fontsize = cl_dd_area=>large

      sap_color    = cl_dd_area=>list_heading_int.

  CLEAR : lv_text.


* Adding GAP
  CALL METHOD lcl_document->add_gap
    EXPORTING
      width = 130.

  lv_text = 'Capital(101).

  CALL METHOD lcl_document->add_text
    EXPORTING
      text         = lv_text
      sap_emphasis = cl_dd_area=>strong " For bold
      sap_style    = cl_dd_area=>heading
      sap_fontsize = cl_dd_area=>large
      sap_color    = cl_dd_area=>list_heading_int.

  CLEAR : lv_text.

* Add new-line
  CALL METHOD lcl_document->new_line.

ENDFORM.   "html_top_of_page

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

Thanks & Regards

Bala Krishna

0 Kudos

hi,

this one is not header gap I am asking

I need gap in the records which i am getting from data base i.e, for row

0 Kudos

Hi,

    The while filling up the final output internal table, when ever a District name is there concatenate few spaces( ALT key + 255 ) ASCII number for space or cl_abap_char_utilities=>cr_lf to give space.

Statename

wa_output-name = wa_temp-name.

District name

CONSTANTS :

  c_con_cret TYPE c VALUE cl_abap_char_utilities=>cr_lf.

CONCATENATE c_con_cret c_con_cret c_con_cret wa_temp-name INTO

                         wa_output-name.

Thanks & Regards

Bala Krishna

0 Kudos

hi ,

  in the debug mode in the internal table i am getting space for those rows but while display i am not getting what i required

0 Kudos

Hi,

     Try the other method, create a constant with 10 spaces using ALT key + 255. Then use that to concatenate.

CONSTANTS : c_10space TYPE c LENGTH 10 VALUE '          '. " The space should be by pressing (ALT+255).

CONCATENATE c_10space wa_temp-name INTO

                         wa_output-name.

Thanks & Regards

Bala Krishna

0 Kudos

thanks Bala Garu , You helped me a lot

0 Kudos

Hi,

     If it is resolved, please close the thread.

Thanks & Regards

Bala Krishna

0 Kudos

Hi Shek Syed,

you can declare the space constant as following :

CONSTANTS  :    c_tab       TYPE abap_char1 VALUE

                                          cl_abap_char_utilities=>horizontal_tab.

Then you can follow the procedure suggested by Mr. Balakrishna. Thank you.

Regards,

kartik