Saturday, November 7, 2009

Down load any database table(with header ) dynamically..........








How to enter long text into database table from front end???




This is program which allows us to insert a long text from front end in SAP R/3 system.


For this created one table name : ztext_editor83 in which there was a field remarks1 whose type was RSRAWSTRING (xstring) which converts cstring to xstring and store it in database table.


if we want to fetch the same remarks then we need to convert xstring to cstring by the following


function module : ECATT_CONV_XSTRING_TO_STRING.






REPORT ztext_editor83.


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


DATA : line_length TYPE i VALUE 254,


editor_container TYPE REF TO cl_gui_custom_container,


text_editor TYPE REF TO cl_gui_textedit,


text TYPE string.
DATA : it_tab TYPE TABLE OF ztext_editor83,

wa_tab TYPE ztext_editor83.

DATA: name TYPE vrm_id,

list TYPE vrm_values,

value LIKE LINE OF list.


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


START-OF-SELECTION.


CALL SCREEN '100'.


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


MODULE status_0100 OUTPUT.


SET PF-STATUS '0100'.


SET TITLEBAR '100'.


CREATE OBJECT editor_container


EXPORTING


container_name = 'TEXTEDITOR'


EXCEPTIONS


cntl_error = 1


cntl_system_error = 2


create_error = 3


lifetime_error = 4


lifetime_dynpro_dynpro_link = 5


OTHERS = 6 .


IF sy-subrc <> 0.


*MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO


* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.


ENDIF.


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


CREATE OBJECT text_editor


EXPORTING


wordwrap_mode = cl_gui_textedit=>wordwrap_at_fixed_position


wordwrap_position = line_length


wordwrap_to_linebreak_mode = cl_gui_textedit=>true


parent = editor_container




IF sy-subrc <> 0.


* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO


* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.


ENDIF.


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


CALL METHOD text_editor->set_toolbar_mode


EXPORTING


toolbar_mode = cl_gui_textedit=>false.


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


CALL METHOD text_editor->set_statusbar_mode


EXPORTING


statusbar_mode = 0. "CL_GUI_TEXTEDIT=>FALSE.


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

SELECT * from pa0000

into TABLE it_pa0000

UP TO 10 ROWS.

LOOP AT it_pa0000 INTO wa_pa0000 .

value-key = wa_pa0000-pernr.

value-text = wa_pa0000-pernr.

APPEND value to list.

ENDLOOP.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = 'WA_TAB-EMP_NO'

values = list

* EXCEPTIONS

* ID_ILLEGAL_NAME = 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.


DATA : W_LINES TYPE I.

TYPES : PICT_LINE(256) TYPE C.

DATA : CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,

EDITOR TYPE REF TO CL_GUI_TEXTEDIT,

PICTURE TYPE REF TO CL_GUI_PICTURE,

PICT_TAB TYPE TABLE OF PICT_LINE,

URL(255) TYPE C.

DATA : GRAPHIC_URL(255).
DATA : BEGIN OF GRAPHIC_TABLE OCCURS 0,

LINE(255) TYPE X,

END OF GRAPHIC_TABLE.

DATA : L_GRAPHIC_CONV TYPE I.

DATA : L_GRAPHIC_OFFS TYPE I.

DATA : GRAPHIC_SIZE TYPE I.

DATA : L_GRAPHIC_XSTR TYPE XSTRING.


CALL METHOD CL_GUI_CFW=>FLUSH.
CREATE OBJECT : CONTAINER EXPORTING CONTAINER_NAME =

'PICTURE_CONTAINER',

PICTURE EXPORTING PARENT = CONTAINER.


CALL METHOD CL_SSF_XSF_UTILITIES=>GET_BDS_GRAPHIC_AS_BMP EXPORTING

P_OBJECT = 'GRAPHICS'

P_NAME = 'ZLOGO_WIPRO'

P_ID = 'BMAP'

P_BTYPE = 'BCOL' RECEIVING

P_BMP = L_GRAPHIC_XSTR

* EXCEPTIONS

* NOT_FOUND = 1

* INTERNAL_ERROR = 2

* others = 3 .

IF SY-SUBRC <> 0.

* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.


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

GRAPHIC_SIZE = XSTRLEN( L_GRAPHIC_XSTR ).

L_GRAPHIC_CONV = GRAPHIC_SIZE.

L_GRAPHIC_OFFS = 0.

WHILE L_GRAPHIC_CONV > 255.

GRAPHIC_TABLE-LINE = L_GRAPHIC_XSTR+L_GRAPHIC_OFFS(255).

APPEND GRAPHIC_TABLE.

L_GRAPHIC_OFFS = L_GRAPHIC_OFFS + 255.

L_GRAPHIC_CONV = L_GRAPHIC_CONV - 255.

ENDWHILE.


GRAPHIC_TABLE-LINE = L_GRAPHIC_XSTR+L_GRAPHIC_OFFS(L_GRAPHIC_CONV). APPEND GRAPHIC_TABLE.


CALL FUNCTION 'DP_CREATE_URL'

EXPORTING

TYPE = 'IMAGE'

SUBTYPE = 'X-UNKNOWN'

SIZE = GRAPHIC_SIZE

LIFETIME = 'T'

TABLES

DATA = GRAPHIC_TABLE

CHANGING

URL = URL.


CALL METHOD PICTURE->LOAD_PICTURE_FROM_URL

EXPORTING

URL = URL.


CALL METHOD PICTURE->SET_DISPLAY_MODE

EXPORTING

DISPLAY_MODE = PICTURE->DISPLAY_MODE_FIT_CENTER.


ENDMODULE. " STATUS_0100 OUTPUT


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


MODULE user_command_0100 INPUT.


IF sy-ucomm = 'BACK' OR sy-ucomm = 'EXIT'.


LEAVE PROGRAM.


ELSEIF sy-ucomm = 'SAVE'.


CALL METHOD text_editor->get_textstream


EXPORTING


only_when_modified = cl_gui_textedit=>true


IMPORTING


text = text


* is_modified =


EXCEPTIONS


error_cntl_call_method = 1


not_supported_by_gui = 2


OTHERS = 3 .


IF sy-subrc <> 0.


* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO


* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.


ENDIF.


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


*******this flush method helps us to bring the buffered data on to front end*************


CALL METHOD cl_gui_cfw=>flush


EXCEPTIONS


cntl_system_error = 1


cntl_error = 2


OTHERS = 3.


IF sy-subrc <> 0.


* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO


* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.


ENDIF.


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


CALL FUNCTION 'SCMS_STRING_TO_XSTRING'


EXPORTING


text = text


IMPORTING


BUFFER = wa_tab-remarks1.


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


modify ztext_editor83 FROM wa_tab.




ENDIF.


ENDMODULE. " USER_COMMAND_0100 INPUT


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


Se51 flow logic :


PROCESS BEFORE OUTPUT.


MODULE STATUS_0100.


PROCESS AFTER INPUT.


MODULE USER_COMMAND_0100.


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


Friday, October 30, 2009

Home!!!

Mom ,'you have come!!!!!!!' as my mom was sleeping and i came home around 12:30 pm .
I touched her feet and said, 'mom, you are not seing the ghost of mine' with smile. She blessed me , 'God, bless you.'..i yelled , 'mom i am hungry, what is there to eat ?' and opened the fridge and tool some water. Mom replied , 'There are so much for you , just make yourself comfortable and relax'.My sister woke up because of the sound which i created . I gave her a watch. She asked 'How much?' i wisphered ,'you eat mangoes , don't count them.' . 'Still how much?',she quizzed ..i revert back 'not much 1700'..i don't know whether she liked it or not as the taste of my choices are not considered in any of the top grade but i was happy for presenting her gift.....this time luckily i got long holidays so i planned to go out some where with mom and sister....but i got a call from my father and this call summerized that i had to go HAPUR for some property work which i hate most....any way some how i managed to complete this task...in up coming days i went many of my friends and also relatives(to whom i actually don't like) not bacause they are bad but there i don't find myself. Once my mom asked 'now you are about to complete 1 year in wipro , are they are going to increase your salary??' ..i yawned 'i don't know but i got EE(exceeding expection ) in my apprisal.'...'Then you must get some increament', mom excitingly said...i questioned back , 'don't be so happy , it can be dry happiness'...'why?' she asked...i replied,'just like that'...i was happy atleast some body is happy for me otherwise nobody showed a sign of happiness...again she quizzed 'if you find any girl then make sure she should not be muslim'...i asked, 'why?'..'big culture difference'she replied....'your son is not that capable to find good girl so please i am giving you this responsibility'..i smilingly said.......finally day of return jorney had come ........

Sunday, October 25, 2009

can't you see that.

'Cancel your leaves and come to office' vinutha balashankar called me, i nodded 'ok but what happened ?' she said 'whatever you ported yesterday in production its not working ', 'Not possible it was working yesterday how can it be possible' i shivringly said . 'Just kidding its a problem from SAP side just wanted to tease you' she replied...'Don't ever do such kind of kiddish things' i said.......finally its time to go to airport and shekhar was in office and we decided to meet at Yekshandra from where airport bus starts....shekhar called me and said 'i will start at 2:00 pm from here so plan accordingly'....then again he called me at 2:15 pm 'where are you?' i said 'Yaar i was sleeping , can we start at 2:30 pm?'. He accepted. Arround 3:00 pm i was at decided place and called shekhar 'kahan hai bhotni k?' , He said 'aa rha hun bhai bus 20 minute'...'sale tune taab to bhot bhokali kar rakkhi thi aabhi 20 minute chal thik hai jaldi aa'....after 15 minutes he called me 'can you see the red colored valvo bus?' i said 'ya i can' . 'stop that bus and get in ' he said...'but i am the other side of the road' i clarified ...he replied 'then cross the road and get in, you stupid' ....i crossed the road without fail and got in the bus while chasing that....after some time i realized this is the same bus which i missed while waiting my dear friend....

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

I asked 'why are sitting with me?' . Shekhar stood up and sat down on the next seat, now we both had one seat free....both were hoping some beautiful faces.....luck was with me , a pretty gal came and sat down with me ....and mr. shaekhar was sitting with an old granpa.....she was talking on phone , after 15 minutes of talk she asked me 'where are you going?' i replied 'i think i am going to airport' ..she smiled and asked 'ya , i mean where are going through flight?' i said 'Delhi and you?' 'Pune' she said....some where i read when a boys talks to pretty gals they usually lost their mind while talking and i experienced the same . I said 'i heard that pune isn't a safe place as there are so many cases of H1N1' ..she said 'so what cases are bangalore also' and i also accepted her statement...'what do you do?' i asked ..'i worked with satyam and in the R&D(java) department' she reverted back to me ..i smiled and said 'then you must be very intelligent' ...she was feeling very proud....she asked me 'what you do?' 'i don't work with satyam and not even in R&D devision' i replied..........with some irritation she looked at me and i said 'i work with wipro and in SAP devision'.....she said 'ok'...after that she preached so many her stories which i cud not able to relate but still was nodding my head with acceptance...............finally airport came we said bye to each other..........now shekhar came to me and said 'bhot baat bana rha tha sale chal ab ye bag utha vaise naam kya tha uska?' ....i thought a bit and said 'i don't know actually i didn't ask'..shekhar replied 'wah mere sher puri ramayan finish ho gyi par seeta ka baap kaun tha ye pta nhi'..............and i said 'ok , ho jata hai kabhi kabhi duniya gol hai phir milagi'.

Thursday, October 15, 2009

where is the true happiness??????

How many times you were really happy? You were happy when a girl accepted your proposal or you were happy when you got your first job or you were happy when you fly first time!!! I don't see any true happiness in those things whenever i sit alone i always find myself alone and isolated......they asked me why you work so hard while you know they are not gonna give you extra amount .......i always reply them i don't have any work there at my room but honestly speaking i feel alone there. When come to me and its nice what you developed , pls resolve this problem its on priority i really feel good but just for a moment . I just got star performer of the month and i can remember the day when one of senior told me told you are not fit person for SAP , thank to him i told him one day i'll be like you or may be better than you ........i am still working on it . My new phase of the same assignment is about to start and this time i am planning go for kill ........need to learn so many technical as well as business also ...........sai baba pls help me.........

Saturday, October 10, 2009

mera desh mahan, i don't know how many are honest insaan????

one of my sister had returned back from dubai and she is so impressed with this beautiful country that she wants to be there only. She has her own dreams and according to her , her dreams can't be fulfilled in india , her perception has changed she thinks we are here rubbed like a dog , there is no standard of living and when i asked would you like to change a bit in this course she reverted back to me with an honest answer "why should i waste my life to clean others shit " and believe me most of us think like this including me also. But its not tuff to make the change , only thing is capable people need to clean shit of one or may be two persons . Don't know it will work or not but at least we can try..............

Saturday, September 26, 2009

office office

Ok sir we are leaving(me and neeraj) , we indicated to smithal sir..."wait, where you people are going its only 8:00 pm"....we passed a smile to sir and he also then he told me there so many developements and enhancements are pending as we are moving to quarter end users are creating issues, ok lets sit and figure out what all are pending and how we are going to complete it........and that day we left office 11:15 pm , not only that day now a day we are coming back around 10:30 pm...working in pressure but i am enjoying this more over neeraj went on leave so my work is more . till now some how i managed ..i don't know how would i mange in upcoming days..........