Cursor position on screen data in module pool programming(urgent)
Hi all,
I developed a module pool program which will save the data after scanning the barcode data.
In my program screen 100 is there which contains field 2dbar. scanned data is comming to 2dbar field.
we r doing scan 4 times.once for vendor number,once for material no. like this.
After 1st scan, vendor number will come to field 2dbar.
Then I developed logic to put comma after each scanned data come to this field 2dbar.
MODULE put_comma INPUT.
CASE OK_CODE.
when ''.
move 2dbar to 2dbar1.
clear 2dbar.
concatenate 2dbar1 ',' into 2dbar2.
*replace 2dbar with 2dbar2 into 2dbar.
move 2dbar2 to 2dbar.
*write 2dbar2 to 2dbar.
condense 2dbar no-gaps.
*move '' to 2dbar.
*set cursor field 2dbar offset 5.
*write
ENDCASE.
ENDMODULE. " put_comma INPUT
By above logic, comma comes to the starting position of 2dbar after each scan. i.e cursor position is coming to the starting position of screen field 2dbar.
Now I need to move the cursor position after the comma position on 2dbar after each scan.
after 1st scan, 2dbar contains
vmotorola
then my logic puts a comma when u put enter on screen 100.
now 2dbar contains
vmotorola,
i should get the cursor position after the comma.but i am getting cursor position before 'v'.so how to move this cursor position beyond comma after each scan.
I added set cursor command but it is not working.plz
What is the logic, I need to put in PAI to move the cursor on selection screen.
Already the logic I have mentioned. with that logic, I can put comma.now I need to add cursor movement logic to move the cursoron on screen field 2dbar.
Plz reply me as it is urgent.
Thanks in advance.
Regards
pabitra
CASE OK_CODE.
when ''.
move 2dbar to 2dbar1.
clear 2dbar.
concatenate 2dbar1 ',' into 2dbar2.
move 2dbar2 to 2dbar.
condense 2dbar no-gaps.
len = strlen ( 2dbar ).
len = len - 1.
set cursor field 2dbar offset len.
ENDCASE.
ENDMODULE. " put_comma INPUT
Similar Messages
-
How to extract the data from module pool program to Excel Sheet?
Hi Guys
I am having a requirement to transfer the data from Module pool screen to excel sheet directly.
This is an urgent requirement.
So plz reply me with some coding examples.
I will give points for that.This report extract excel file. From that concept you can easily extract data from module pool program also by coding in PAI of the screen.
REPORT ztest1 .
* this report demonstrates how to send some ABAP data to an
* EXCEL sheet using OLE automation.
include ole2incl.
* handles for OLE objects
data: h_excel type ole2_object, " Excel object
h_mapl type ole2_object, " list of workbooks
h_map type ole2_object, " workbook
h_zl type ole2_object, " cell
h_f type ole2_object, " font
h_c type ole2_object. " color
DATA: FILENAME LIKE RLGRAP-FILENAME.
tables: spfli.
data h type i.
* table of flights
data: it_spfli like spfli occurs 10 with header line.
*& Event START-OF-SELECTION
start-of-selection.
* read flights
select * from spfli into table it_spfli.
* display header
uline (61).
write: / sy-vline no-gap,
(3) 'Flg'(001) color col_heading no-gap, sy-vline no-gap,
(4) 'Nr'(002) color col_heading no-gap, sy-vline no-gap,
(20) 'Von'(003) color col_heading no-gap, sy-vline no-gap,
(20) 'Nach'(004) color col_heading no-gap, sy-vline no-gap,
(8) 'Zeit'(005) color col_heading no-gap, sy-vline no-gap.
uline /(61).
* display flights
loop at it_spfli.
write: / sy-vline no-gap,
it_spfli-carrid color col_key no-gap, sy-vline no-gap,
it_spfli-connid color col_normal no-gap, sy-vline no-gap,
it_spfli-cityfrom color col_normal no-gap, sy-vline no-gap,
it_spfli-cityto color col_normal no-gap, sy-vline no-gap,
it_spfli-deptime color col_normal no-gap, sy-vline no-gap.
endloop.
uline /(61).
* tell user what is going on
call function 'SAPGUI_PROGRESS_INDICATOR'
exporting
* PERCENTAGE = 0
text = text-007
exceptions
others = 1.
* start Excel
create object h_excel 'EXCEL.APPLICATION'.
* PERFORM ERR_HDL.
set property of h_excel 'Visible' = 1.
* CALL METHOD OF H_EXCEL 'FILESAVEAS' EXPORTING #1 = 'c:kis_excel.xls'
* PERFORM ERR_HDL.
* tell user what is going on
call function 'SAPGUI_PROGRESS_INDICATOR'
exporting
* PERCENTAGE = 0
text = text-008
exceptions
others = 1.
* get list of workbooks, initially empty
call method of h_excel 'Workbooks' = h_mapl.
perform err_hdl.
* add a new workbook
call method of h_mapl 'Add' = h_map.
perform err_hdl.
* tell user what is going on
call function 'SAPGUI_PROGRESS_INDICATOR'
exporting
* PERCENTAGE = 0
text = text-009
exceptions
others = 1.
* output column headings to active Excel sheet
perform fill_cell using 1 1 1 200 'Carrier id'(001).
perform fill_cell using 1 2 1 200 'Connection id'(002).
perform fill_cell using 1 3 1 200 'City from'(003).
perform fill_cell using 1 4 1 200 'City to'(004).
perform fill_cell using 1 5 1 200 'Dep. Time'(005).
loop at it_spfli.
* copy flights to active EXCEL sheet
h = sy-tabix + 1.
if it_spfli-carrid cs 'AA'.
perform fill_cell using h 1 0 000255000 it_spfli-carrid.
elseif it_spfli-carrid cs 'AZ'.
perform fill_cell using h 1 0 168000000 it_spfli-carrid.
elseif it_spfli-carrid cs 'JL'.
perform fill_cell using h 1 0 168168000 it_spfli-carrid.
elseif it_spfli-carrid cs 'LH'.
perform fill_cell using h 1 0 111111111 it_spfli-carrid.
elseif it_spfli-carrid cs 'SQ'.
perform fill_cell using h 1 0 100100100 it_spfli-carrid.
else.
perform fill_cell using h 1 0 000145000 it_spfli-carrid.
endif.
if it_spfli-connid lt 400.
perform fill_cell using h 2 0 255000255 it_spfli-connid.
elseif it_spfli-connid lt 800.
perform fill_cell using h 2 0 077099088 it_spfli-connid.
else.
perform fill_cell using h 2 0 246156138 it_spfli-connid.
endif.
if it_spfli-cityfrom cp 'S*'.
perform fill_cell using h 3 0 155155155 it_spfli-cityfrom.
elseif it_spfli-cityfrom cp 'N*'.
perform fill_cell using h 3 0 189111222 it_spfli-cityfrom.
else.
perform fill_cell using h 3 0 111230222 it_spfli-cityfrom.
endif.
if it_spfli-cityto cp 'S*'.
perform fill_cell using h 4 0 200200200 it_spfli-cityto.
elseif it_spfli-cityto cp 'N*'.
perform fill_cell using h 4 0 000111222 it_spfli-cityto.
else.
perform fill_cell using h 4 0 130230230 it_spfli-cityto.
endif.
if it_spfli-deptime lt '020000'.
perform fill_cell using h 5 0 145145145 it_spfli-deptime.
elseif it_spfli-deptime lt '120000' .
perform fill_cell using h 5 0 015215205 it_spfli-deptime.
elseif it_spfli-deptime lt '180000' .
perform fill_cell using h 5 0 000215205 it_spfli-deptime.
else.
perform fill_cell using h 5 0 115115105 it_spfli-deptime.
endif.
endloop.
* EXCEL FILENAME
CONCATENATE SY-REPID '_' SY-DATUM+6(2) '_' SY-DATUM+4(2) '_'
SY-DATUM(4) '_' SY-UZEIT '.XLS' INTO FILENAME.
CALL METHOD OF H_MAP 'SAVEAS' EXPORTING #1 = FILENAME.
free object h_excel.
perform err_hdl.
* FORM FILL_CELL *
* sets cell at coordinates i,j to value val boldtype bold *
form fill_cell using i j bold col val.
call method of h_excel 'Cells' = h_zl
exporting
#1 = i
#2 = j.
perform err_hdl.
set property of h_zl 'Value' = val .
perform err_hdl.
get property of h_zl 'Font' = h_f.
perform err_hdl.
set property of h_f 'Bold' = bold .
perform err_hdl.
set property of h_f 'Color' = col.
perform err_hdl.
endform. "FILL_CELL
*& Form ERR_HDL
* outputs OLE error if any *
* --> p1 text
* <-- p2 text
form err_hdl.
if sy-subrc <> 0.
write: / 'OLE-Automation Error:'(010), sy-subrc.
stop.
endif.
endform. " ERR_HDL -
Screen problem in Module pool program
Hi all,
I have developed a module pool program, in which i have used simple selection screen and after executing it will call screen 9001 to display the data. everything is goin fine but if i leave my output screen as it is for some time (or even if i lock my system then unlock it) i am getting an error message
"Selection screen ZDEV1110PGM_SF 1000 was not called using CALL SELECTION-SCREEN".
do any one have idea why this is happining without doing anything further to the output.
Regards,
NilanjanaHave you used CALL SCREEN ?
Regards
Abhii -
Screen Attributes in Module Pool Programming
Dear Experts,
In Module Pool Programming, if we write LOOP AT SCREEN we can see and modify SCREEN-ACTIVE, SCREEN-INVISIBLE and other fields. But where we can modify Data Type and Other Attributes of the field dynamically?
Thanks in advance.
Regards,
KumarHello Kumar,
you can not change data type of a screen field dynamically. What you can change is an output length of a field. This can be done changing the value of SCREEN-LENGTH.
Regards
Adrian -
Using logical database to fetch data in Module Pool programming
I am unable to use logical database to fetch data in case of Module pool programming. Has anyone ever faced problems with it...?
use f.m LDB_PROCESS....
refer demo program DEMO_LOGICAL_DATABASE -
F4 help for the screen fields in module pool program
Hi All,
I have a requirement that, i want to provide F4 help for the 2 fields in module pool program. the fields are document number and fiscal year from rbkp table.
i could provide search help for two fields.
but how to select matching fiscal year for that document number.
problem: i am getting fiscal year as first four digits of document number.
please help me to solve this problem.
Thanks & Regards,
Namratha.VHi,
If your requirement is after selecting the document no from f4 help then the corresponding year should be updated in the document year field then use FM --> DYNP_VALUES_UPDATE
In this function module pass the screen no program & field for which u want to update value -
Total screen shots for module pool programming
Hi Abapers,
Any one could send me the screen shots for the module pool programming with multiple screens.
Thanks in advance.
Regards
YubiYou can check the transaction ABAPDOCU for sample programs..
Check the prgrams:
DEMO_DYNPRO_TABLE_CONTROL_1 Table Control with LOOP Statement
DEMO_DYNPRO_TABLE_CONTROL_2 Table Control with LOOP AT ITAB
Also chk this thread.
Urgent: : Requiremnt on module pool -
Function module / table which lists screen numbers in module pool program
Hi everyone,
I wish to make a list of all screen numbers used in my module pool program Is there any FM / table which maps module pool program name with all the screens used in it?
For example, if my module pool is SAPMZPROG and it has screens 9001, 9002 and 9003, then I want to have a report as follows:
Input to the report (selection screen): SAPMZPROG
Output:
9001
9002
9003
Thanks,
ShaileshHello
Try tables D020S, D020T -
Hi Friends..
I am working on a module pool program where I am using Z_BAPI_ADDREMPAU_CREATE and Z_BAPI_ADDREMPAU_CHANGE inside my Zmodule program. I have copied this these BAPIs from Standard BAPI. The reason I created this ZBAPIs because I have created a new fields on the screen in which when I press SAVE button ..these extra fields should also saved.
I am facing a different problem when I am debugging each line ..it is saving into database table( pa0006). But when I press SAVE ..it is going into short dump. I could not understand why this problem is coming. Either it is giving this dump problem or the BAPI is returning a complex application error has occurred
The DUMP is :- Incorrect internal format of ABAP Program SAPLHRMM
Correct the error:- Try regenerating the program SAPLHRMM
Please help.Hi Ravi,
This is the code in my ZFm.
I am calling bapi_addrempua_change in my ZFM first and then moving extra fields to p0006.
please have a look.
'BAPI_ADDREMPAU_CHANGE'
EXPORTING
EMPLOYEENUMBER = EMPLOYEENUMBER
SUBTYPE = SUBTYPE
OBJECTID = OBJECTID
LOCKINDICATOR = LOCKINDICATOR
VALIDITYBEGIN = VALIDITYBEGIN
VALIDITYEND = VALIDITYEND
RECORDNUMBER = RECORDNUMBER
CONAME = CONAME
STREETANDHOUSENO = STREETANDHOUSENO
CITY = CITY
SCNDADDRESSLINE = SCNDADDRESSLINE
HOUSENUMBER = HOUSENUMBER
APARTMENTID = APARTMENTID
POSTALCODECITY = POSTALCODECITY
DISTRICT = DISTRICT
STATE = STATE
COUNTRY = COUNTRY
TELEPHONENUMBER = TELEPHONENUMBER
DISTANCEINKM = DISTANCEINKM
DISTANCEINKM1 = DISTANCEINKM1
COMPANYOWNEDAPT = COMPANYOWNEDAPT
BUSROUTE = BUSROUTE
NOCOMMIT =
IMPORTING
RETURN = RETURN.
Telephone Number
P0006-ZZCN_CODE_TEL = TELEPHONECOUNTRYCODE.
P0006-ZZAREA_CODE_TEL = TELEPHONEAREACODE.
Mobile Number
P0006-ZZCN_CODE_MOB = MOBILECODE.
P0006-ZZAREA_CODE_MOB = MOBAREACODE.
P0006-ZZMOB_NO = MOBILE.
Fax Number
P0006-ZZCN_CODE_FAX = FAXCODE.
P0006-ZZAREA_CODE_FAX = FAXAREACODE.
P0006-ZZFAXNR = FAX.
Email Address
P0006-ZZSMTP_ADDR = EMAILADDRESS.
Location.
P0006-ZZPLOC = LOCATION.
Location description
P0006-ZZPLOCDESC = LOCATIONDESC. -
Module Pool Programming - URGENT!!!
Hi Friends,
I have a screen with 3 radiobuttons and when I call a next screen and come bacl to the main screen, the radio button is not placed properly.
Eg. I have 3 radiobuttons: 1. All ITEMS (default X)
2. Open I TEMS
3. Closed ITEMS
If I clicked Open Items readio button and go to the details screen, if I click to back button and call the screen, then the radio button is placed on all items.
If there anyway that I can see the radiobutton in the same position as I had clicked?
Please tell me its urgent..........Hi,
This is bcz u have given default value as <b>clicked</b> for <b>All Items</b> radio button. So when u call next screen and come back to the main screen the default value is retained.
Regards,
sowmya -
Adding a screen element in Module pool
Hi Experts,
How to add a screen element in module pool programming?
Thanks,
Sudha...........Hi sudha ,
To add screen elements in you module pool programming ,
i > Go the layout of the screen for which you want to have elements .
ii> Drag and drop the available elements from the left hand side .
iii> Be sure to have a name a name of the data elements that you have inserted .
iv>Check any dataelement is't showing red in color as red color signifies error .
v> Make sure to save and activate the layout.
Hope this would be clear .
Thanks
Lokesh -
Regarding screen flow in MODULE POOL
Hi everyone,
my requirement is to cretae a module pool program. In between a program is submitted VIA a selection screen. That selection screen contains PUSH BUTTONS. If any push button is clicked one of the dialog screens of the module pool program should be called. Can any one tell me how can this be done.
Thanks in advance.
Regards,
Y.Gauthamwrite a Module in PAI of ur screen and call which ever screen u want to call or leave.
for e.g -
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.
module USER_COMMAND_0100 input.
case ok_code.
when 'ENTER'.
clear ok_code.
leave to screen 200.
endcase.
endmodule. " USER_COMMAND_0100 INPUT -
Call Module pool program in report
Dear guys,
i have Module pool program ZSDMODPOOL,which is transaction ZSDORD(ADDON SCREEN),Which creates sales order and shipment.
Now i want, one new screen to display before this ZSDORD Screen. In new screen i will have Table control having Internal table displaying in it.
Now, My requirement is how to pass this New screen internal table datas into Module pool program.
or i can put question as how to call module pool program
from other report program or screen.
Pls give me ideas.
ambichanYou can call the transaction using CALL TRANSACTION, or you can setup a DIALOG and call it using CALL DIALOG. Using CALL DIALOG you will be able to pass values. You create a DIALOG via transation SE35.
Regards,
Rich Heilman -
How to save a varaints in module pool programming
Hi All,
How to save a varaints in module pool programming.
Thanks in Advance.
GS.Hi,
Forgot my previous reply.
Just now I checked.
Create transaction[say.,zzz_test1] using SE93 [choose the option Program and screen] for your module pool program.
Then use SHDS transaction to create a variant[say zzz_v1] for the transaction you created above.
Then use SE93 [choose the option Transaction with Variant] to create another transaction zzz_test2 by mentioning the module pool program name and zzz_test1 transaction which you created and zzz_v1 variant which you created.
Then if you run the transaction ZZZ_test2,then you can see the variant values.
I created just now all these and it works.
Hope this is clear.
If not,get back. -
How to insert Logo in module pool programming
Plz any one can explain me that how we will inseart Logo on screens by using module pool programming (in GUI programming) .
Hello.
I'll give you an example of inserting a personal photo in UI programming. Hope it helps you.
First of all, in your screen (painter), insert a custom control and give it a name (PHOTO in my example).
Then, in your screen PBO, insert a coding like this:
CLEAR handle.
CALL FUNCTION 'HR_IMAGE_INIT'
EXPORTING
p_pernr = pernr
p_tclas = 'A'
container = 'PHOTO'
IMPORTING
handle = handle
EXCEPTIONS
no_document = 1
internal_error = 2
OTHERS = 3.
CALL FUNCTION 'HR_IMAGE_SHOW'
EXPORTING
p_pernr = pernr
p_tclas = 'A'
handle = handle
EXCEPTIONS
invalid_handle = 1
no_document = 2
internal_error = 3
OTHERS = 4.
Regards.
Valter Oliveira.
Maybe you are looking for
-
After install iLife '11, iWeb does not show the picture
After install iLife '11 , I need to edit some pages of an existing website (stored on my HD) When I open the page I would edit (it's a page that contains some photo gallery) I see that the picture gallery is empty and if I try to publish the page whe
-
Dispute (refund on hold)
More a question regarding; proper way to contact Paypal, given just 3 choices when on the 'requiring your action' page. (page states)How would you like to resolve?(three option are presented)1) Issue the buyer a full refund2) I can provide compelling
-
Is there any way to set more than one list validation setting?
Can I set more than one list validation setting without using any coding? It seems strange that you can only have ONE per list (and I don't want just a single column validation).
-
Athough both LightRoom and CS5 both have profiles for the 24-120 Nikkor lens, it is not the New Nikkor 24-120 F4 lens. I would assume that it will be in the next release of Lightroom. Right now, I edit the raw .nef file in CS5 and then open "Lens Pro
-
Please help me in driver installation of canon lbp2900. Does anyone have a ppd file for it or any other solution. Any thing that can be build from linux drivers?